Home Directory Plugins Network Protocols DNS check_zone_record_value

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

Directory Tree


0 votes
Current Version
Last Release Date
Compatible With
  • Nagios 3.x
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Plugin designed to check value of some records of a zone by parsing the BIND zone file.
Best way to use it is call thisplugin from another bash script with all parameters to check, like this:

[root@nagios-devel:~]# cat /usr/lib64/nagios/plugins/check_zone_record_value_-_contingencia_e-test.com.br

/usr/lib64/nagios/plugins/check_zone_record_value \
-c 1
-f '/var/named/chroot/dbfiles_external_contingencia/db/e-test.com.br.zone' \
--ns ns1.test.com.br.
--ns ns2.test.com.br.
--ns ns3.test.com.br.

--mx 0:etest-com-br0c.mail.protection.outlook.com.

--a acesso:
--a acesso1:
--a bandeirante:
--a centraldeservicos:
--a centralservicos:
--a cob:
--a cob-h:
--a cobranca:
--a ctt:
--a execplan:
--a ftp1:
--a gbbd:
--a ged:
--a gestor:
--a gestorp:
--a imap:
--a kacev2:
--a mediaservices:
--a metropolitana:
--a mobile:
--a mobilebanking:
--a mobilectt:
--a mobileib:
--a mobileservices-homo:
--a mobileservices-prod:
--a nimsoft:
--a orquestra:
--a pep:
--a perdiminhasenha:
--a pop:
--a portal:
--a portalsc:
--a portalv1:
--a portalv2:
--a sa:
--a simuladores:
--a sisda:
--a sisdacob:
--a siteubr:
--a smtp:
--a sobras:
--a sop:
--a sura:
--a tecnobi:
--a testnet:
--a testnetp:
--a vpn:
--a vpnssl:
--a vpnssl2:
--a webmail:
--a www:

--cname autodiscover:autodiscover.outlook.com.
--cname lyncdiscover:webdir.online.lync.com.
--cname modulo:gbbd
--cname msoid:clientconfig.microsoftonline-p.net.
--cname sip:sipdir.online.lync.com.
--cname vulpecula:pep

--srv _sipfederationtls._tcp:1:100:5061:sipfed.online.lync.com.
--srv _sip._tls:1:100:443:sipdir.online.lync.com.

--txt '"v=spf1 include:spf.protection.outlook.com -all"'


OK - Checked "66" records. None problem found.|"Total Checks"=66;;0; "Total Errors"=0;;0; "A Errors"=0;;0; "NS Errors"=0;;0; "MX Errors"=0;;0; "PTR Errors"=0;;0; "SRV Errors"=0;;0; "TXT Errors"=0;;0; "CNAME Errors"=0;;0;
[root@aquila:NS3:~]# bash /tmp/check_

CRITICAL - Found "9" problems of "67" records checked: A (Errors: 5, Names:, ctt, metroolitana, mobilservices-prod, www), CNAME (Errors: 2, Names: modulo, si), SRV (Errors: 1, Names: sipdir.online.lync.com.), TXT (Errors: 1, Names: "v=spf1 iclude:spf.protection.outlook.com -all")|"Total Checks"=67;;0; "Total Errors"=9;;0; "A Errors"=5;;0; "NS Errors"=0;;0; "MX Errors"=0;;0; "PTR Errors"=0;;0; "SRV Errors"=1;;0; "TXT Errors"=1;;0; "CNAME Errors"=2;;0;


[root@nagios-devel:~]# /usr/lib64/nagios/plugins/check_zone_record_value --help


Script : check_zone_record_value
Version : 1.0.0
Author : Otavio Gloria (og@e-trust.com.br)
Criation: 02/06/2015


check_zone_record_value -[h|u|v] [--help|--usage|--version]
check_zone_record_value -f [-w|-c ] [-i]
check_zone_record_value -f --a|--ns|--mx|--ptr|--srv|--txt


Nagios plugin to check if some bind record has some value analizing a zone file.


-h|--help Show a help message.
-u|--usage Show how to use this plugin.
-v|--version Show plugin version.
-f|--file Path to bind zone file to be checked.
-w|--warning Warning threshold. Must be a integer.
-c|--critical Critical threshold. Must be a integer.
-i|--info Return just information state. Never alert.
--a Check A record type
--ns Check NS record type
--mx Check MX record type
--ptr Check PTR record type
--srv Check SRV record type
--txt Check TXT record type
--cname Check CNAME record type

Record checks data sytax:

--a ipv4
--a name:ipv4
--ns value
--ns name:value
--mx priority:value
--mx name:priority:value
--ptr ip:name
--srv priority:weight:port:value
--srv name:priority:weight:port:value
--txt 'text' (Must be between single quotes)
--txt 'name>:text' (Must be between single quotes)
--cname name:name

Data types:

IPv4 address like or
Peace of IPv4 address like 154 or 249.10 or 9.78.151
Can be a single text string like web-server or www69
Can be a FQDN like test.com.br or exemplo.com.
Can be @ that represents $ORIGIN
Can be a single string like ns2 or srv-01
Can be a FQDN like test.com.br or mail.google.com.
A integer number only
A integer number only
A integer number only
Can be a string with space, igual, colon and quotes


check_zone_record_value -f /var/named/zones/test.com.zone --a test: --cname www:webserver
check_zone_record_value -f /var/named/zones/test.com.zone --txt '@:v=spf1 include:spf.protection.outlook.com'
check_zone_record_value -f /var/named/zones/test.com.zone --mx 0:test.mail.protection.outlook.com.
check_zone_record_value -f /var/named/zones/test.com.zone --srv _sip._tls:1:100:443:sipdir.online.lync.com.
check_zone_record_value -f /var/named/zones/test.com.zone --ns ns1.test.com.
check_zone_record_value -f /var/named/zones/152- --ptr 154:mail.test.com.

check_zone_record_value -f /var/named/zones/test.com.zone -w 1 -c 5
--ns ns1.test.com. --ns ns2.test.com. --mx 0:test.mail.protection.outlook.com.
--a ns1: --a ns2: --a test: --a smtp1:
--a nagios: --a webserver:192.168.3. --cname www:webserver
--srv _sip._tls:1:100:443:sipdir.online.lync.com. --txt '@:"MS=ms89157621"'