Monitoring Bind9 in Zabbix

For example, I will describe the option of monitoring the DNS server Bind9 in Zabbix.

To start, we turn on the Bind9 statistics, open the configuration file in a text editor, for example nano (Ctrl+X to exit, y/n to save or discard changes):

sudo nano /etc/bind/named.conf

And add the following lines (where the first IP and port is the interface on which statistics will be visible, and the following – from which access to it is allowed):

statistics-channels {
     inet port 8053 allow {;;;};

And restart Bind to apply the changes:

sudo /etc/init.d/bind9 restart

After that, in the browser typing you can see Bind9 statistics.

We will install the necessary components necessary for obtaining statistics from the terminal:

sudo apt-get install xml2 curl

Check if the statistics are displayed:

curl 2>/dev/null | xml2 | grep -A1 queries

Now we will add the parameters of Zabbix agent /etc/zabbix/zabbix_agentd.conf to the parameters that we will monitor:

# The number of connections udp to DNS:,netstat -nua | grep :53 | wc -l
# Number of tcp connections to DNS:,netstat -nta | grep :53 | wc -l
# Number of incoming and outgoing requests:[*],curl 2>/dev/null | xml2 | grep -A1 "/isc/bind/statistics/server/queries-in/rdtype/name=$1$" | tail -1 | cut -d= -f2
UserParameter=bind.queries.out[*],curl 2>/dev/null | xml2 | grep -A1 "/isc/bind/statistics/views/view/rdtype/name=$1$" | tail -1 | cut -d= -f2

And restart the Zabbix agent to apply the changes:

sudo /etc/init.d/zabbix-agent restart

Add data and graphics elements to the desired network node or template in the Zabbix server (type – Zabbix agent, examples of keys below):[A]

See also my article:
Monitoring DNS from Zabbix