With snmpd already installed, download the SNMP Extend script for PDNS
wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns.py -O /etc/snmp/powerdns.py
Make the script executable
chmod +x /etc/snmp/powerdns.py
Allow the Debian-snmp
user to execute the script using sudo without a password
echo "Debian-snmp ALL = NOPASSWD: /etc/snmp/powerdns.py" >> /etc/sudoers.d/snmp-extend
Configure the script in the main snmpd config. Add the following line to /etc/snmp/snmpd.conf
echo -e "\n#PDNS Authoratative Server\nextend powerdns /usr/bin/sudo /etc/snmp/powerdns.py" >> /etc/snmp/snmpd.conf
Restart snmpd
systemctl restart snmpd.service
Everything together
wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns.py -O /etc/snmp/powerdns.py
chmod +x /etc/snmp/powerdns.py
echo "Debian-snmp ALL = NOPASSWD: /etc/snmp/powerdns.py" >> /etc/sudoers.d/snmp-extend
echo -e "\n#PDNS Authoratative Server\nextend powerdns /usr/bin/sudo /etc/snmp/powerdns.py" >> /etc/snmp/snmpd.conf
systemctl restart snmpd.service
With snmpd already installed, download the SNMP Extend script for PDNS
wget https://github.com/librenms/librenms-agent/raw/master/snmp/powerdns-recursor -O /etc/snmp/powerdns-recursor
Make the script executable
chmod +x /etc/snmp/powerdns-recursor
Allow the Debian-snmp
user to execute the script using sudo without a password
echo "Debian-snmp ALL = NOPASSWD: /etc/snmp/powerdns-recursor" >> /etc/sudoers.d/snmp-extend
Configure the script in the main snmpd config. Add the following line to /etc/snmp/snmpd.conf
echo -e "\n#PDNS Recursive Server\nextend powerdns-recursor /usr/bin/sudo /etc/snmp/powerdns-recursor" >> /etc/snmp/snmpd.conf
Restart snmpd
systemctl restart snmpd.service