Skip to content

Template: PowerDNS and PowerDNS Recursor

PowerDNSPowerDNS 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.

  1. First, head over to Zabbix Share to fetch the template.
  2. On the host(s) you wish to monitor, add the following at the bottom of “/etc/sudoers”
    1. PDNS
      # Zabbix Agent PDNS
      Defaults:zabbix !requiretty
      zabbix ALL=NOPASSWD: /usr/bin/pdns_control
    2. PDNS Recursor
      # Zabbix Agent PDNS Recursor
      Defaults:zabbix !requiretty
      zabbix ALL=NOPASSWD: /usr/bin/rec_control
  3. Make sure the following line is present in your Zabbix Agent configuration file “/etc/zabbix/zabbix_agentd.conf”
    1. Include=/etc/zabbix/zabbix_agentd.d/
  4. Create two additional Zabbix Agent configuration files with the following content
    1. pdns.conf (/etc/zabbix/zabbix_agentd.d/pdns.conf)
      UserParameter=pdns_stats[*],/usr/bin/sudo /usr/bin/pdns_control show $1
    2. pdns_recursor.conf (/etc/zabbix/zabbix_agentd.d/pdns_recursor.conf)
      UserParameter=pdnsrec_stats[*],/usr/bin/sudo /usr/bin/rec_control get $1
  5. Restart the Zabbix Agent to load the new configuration files.
  6. Create the following value map (Administration -> General -> Value mapping: Create value map)
    1. Name: PowerDNS Security Status
      0 ⇒ Resolution failure
      1 ⇒ OK
      2 ⇒ Upgrade recommended
      3 ⇒ Upgrade mandatory
  7. Import the template and assign it to your host(s).

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.