PowerDNS is a high-performance DNS server and recursor written in C++ and Zabbix can easily keep track of how it’s doing!
It runs on most Unix variants. It features a large number of different back-ends ranging from simple BIND style zone files to relational databases and load balancing/failover algorithms. A DNS recursor is provided as a separate program.
Also, the history of PowerDNS is very intriguing and more can be found about it here.
Below are instructions and template for monitoring vital statistics of both the PDNS authoritative server and the PDNS Recursor.
Requirements
- PDNS and/or PDNS Recursor 3.x and above.
- Zabbix Agent on the monitored host.
- Zabbix 2.x and above.
How it works
The template export file includes two templates. One for the PDNS authoritative server and one for the PDNS recursor. They function independently and either one can be disabled if necessary.
Using the Zabbix Agent, “pdns_control” and “rec_control” are regularly polled for statistics about the PDNS authoritative server and the PDNS Recursor.
When appropriate, items in the two templates have been created using “Store Value – Delta (speed per second)”. Remaining items that present “current state” information (like Uptime, Latency and Security Status) are stored “As is”.
Running “pdns_control” and “rec_control” requires root privileges and thus it is required to delegate root authority to the zabbix user for these two binaries specifically.
Disclaimer
The templates do not include any preconfigured triggers. The templates are intended primarily for gathering information about your DNS services, how they are performing and to gain insight into how you can optimize them.
Instructions and template have been built and tested using CentOS 6.7 and CentOS 7.0
Instructions – PowerDNS and PowerDNS Recursor
NOTE: The Sudo and Zabbix Agent configuration steps have to be performed on each host you wish to monitor.
- First, head over to Zabbix Share to fetch the template.
- On the host(s) you wish to monitor, add the following at the bottom of “/etc/sudoers”
- PDNS
# Zabbix Agent PDNS Defaults:zabbix !requiretty zabbix ALL=NOPASSWD: /usr/bin/pdns_control
- PDNS Recursor
# Zabbix Agent PDNS Recursor Defaults:zabbix !requiretty zabbix ALL=NOPASSWD: /usr/bin/rec_control
- PDNS
- Make sure the following line is present in your Zabbix Agent configuration file “/etc/zabbix/zabbix_agentd.conf”
Include=/etc/zabbix/zabbix_agentd.d/
- Create two additional Zabbix Agent configuration files with the following content
- pdns.conf (/etc/zabbix/zabbix_agentd.d/pdns.conf)
UserParameter=pdns_stats[*],/usr/bin/sudo /usr/bin/pdns_control show $1
- pdns_recursor.conf (/etc/zabbix/zabbix_agentd.d/pdns_recursor.conf)
UserParameter=pdnsrec_stats[*],/usr/bin/sudo /usr/bin/rec_control get $1
- pdns.conf (/etc/zabbix/zabbix_agentd.d/pdns.conf)
- Restart the Zabbix Agent to load the new configuration files.
- Create the following value map (Administration -> General -> Value mapping: Create value map)
- Name: PowerDNS Security Status
0 ⇒ Resolution failure
1 ⇒ OK
2 ⇒ Upgrade recommended
3 ⇒ Upgrade mandatory
- Name: PowerDNS Security Status
- Import the template and assign it to your host(s).
Is this instruction set still valid? I can find a Zabbix template for dnsdist but not for PowerDNS on the Zabbix share site.
Hi Eric. The instructions should still be valid, but the template on share.zabbix.com seems to have been lost to time.
However I found someone who copied the template at some point to their GitHub. You can find it here: https://github.com/jsoref/zabbix-templates/tree/master/powerdns
i am unable to get graphs polling for pdns-recursor. kindly help. i am using zabbix 4.6.6 and followed this manual to the T.