Linux DNS Server (Bind 9.6.X and high,named) http://www.isc.org/software/bind
I use bind util
/usr/sbin/rndc stats
This command write statistics in file /var/named/chroot/var/named/named.stats (run from zabbix_bind.9.6_stats.pl)
Script /etc/zabbix/zabbix_bind.9.6_stats.pl write statistics for Zabbix in file /tmp/zabbix_named.stats.txt
Per Zone Query Statistics via Zabbix Low Level Descovery (LLD) (bind option zone-statistics yes) which is only available in Zabbix 2.0 and high.
Permissions on script /etc/zabbix/zabbix_bind.9.6_stats.pl
Install perl-suidperl rpm!!!!!
Bind configuration:
/var/named/chroot/etc/named.conf
named.stats format is
zabbix_named.stats.txt format is
Zabbix_agent configuration:
/etc/zabbix/zabbix_agentd.conf
P.S. For Linux DNS Server (Bind < 9.6.X) see
7.02.2013 Update template and script.
18.02.2013 Cache DB RRsets graph is changed.
I use bind util
/usr/sbin/rndc stats
This command write statistics in file /var/named/chroot/var/named/named.stats (run from zabbix_bind.9.6_stats.pl)
Script /etc/zabbix/zabbix_bind.9.6_stats.pl write statistics for Zabbix in file /tmp/zabbix_named.stats.txt
Per Zone Query Statistics via Zabbix Low Level Descovery (LLD) (bind option zone-statistics yes) which is only available in Zabbix 2.0 and high.
Permissions on script /etc/zabbix/zabbix_bind.9.6_stats.pl
Code:
-rwsr-xr-x 1 root root 2791 Feb 5 17:43 zabbix_bind.9.6_stats.pl
Bind configuration:
/var/named/chroot/etc/named.conf
Code:
options {
....
statistics-file "/var/named/data/named.stats";
zone-statistics yes;
....
};
Code:
+++ Statistics Dump +++ (1359454981)
++ Incoming Requests ++
27091010 QUERY
6 NOTIFY
147613 UPDATE
++ Incoming Queries ++
21391676 A
170766 NS
571 CNAME
32702 SOA
2396687 PTR
1 HINFO
1892715 MX
527469 TXT
1 RP
10 AFSDB
497490 AAAA
13384 SRV
1 NAPTR
76700 A6
7 DS
1 SSHFP
7 NSEC
1 NSEC3PARAM
2 TYPE52
87131 SPF
564 AXFR
3123 ANY
1 Others
++ Outgoing Queries ++
[View: default]
3538575 A
82311 NS
....
Code:
date: 1359454981 Tue Jan 29 14:23:01 2013 Cache_DB_RRsets_View_default_A: 16929 Cache_DB_RRsets_View_default_AAAA: 1084 Cache_DB_RRsets_View_default_CNAME: 2195 Cache_DB_RRsets_View_default_DLV: 3 Cache_DB_RRsets_View_default_DNSKEY: 199 Cache_DB_RRsets_View_default_DS: 267 Cache_DB_RRsets_View_default_MX: 396 Cache_DB_RRsets_View_default_NS: 13029 Cache_DB_RRsets_View_default_NSEC: 1587 Cache_DB_RRsets_View_default_NXDOMAIN: 2956 Cache_DB_RRsets_View_default_PTR: 2184 Cache_DB_RRsets_View_default_RRSIG: 2372 Cache_DB_RRsets_View_default_SPF: 5 Cache_DB_RRsets_View_default_SRV: 1 Cache_DB_RRsets_View_default_TXT: 252 Cache_DB_RRsets_View_default__A: 51 Cache_DB_RRsets_View_default__AAAA: 12 Cache_DB_RRsets_View_default__DLV: 18 Cache_DB_RRsets_View_default__DS: 1607 Cache_DB_RRsets_View_default__MX: 13 Cache_DB_RRsets_View_default__NS: 1 Cache_DB_RRsets_View_default__SPF: 236 Cache_DB_RRsets_View_default__TXT: 170 Incoming_Queries_A: 21391676 Incoming_Queries_A6: 76700 Incoming_Queries_AAAA: 497490 Incoming_Queries_AFSDB: 10
/etc/zabbix/zabbix_agentd.conf
Code:
Timeout=30 ## Named monitoring UserParameter=named_stat,/etc/zabbix/zabbix_bind.9.6_stats.pl UserParameter=named_lld,/etc/zabbix/zabbix_bind.9.6_stats.pl lld UserParameter=named[*],egrep -i "$1:" /tmp/zabbix_named.stats.txt|sed 's/.*:\t//' UserParameter=named_udp,netstat -nua | grep :53 | wc -l UserParameter=named_tcp,netstat -nta | grep :53 | wc -l ## End Named monitoring
7.02.2013 Update template and script.
18.02.2013 Cache DB RRsets graph is changed.
Comment