Skip to content

thorfi/nagios-bind9-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nagios Plugins for BIND9 and DNS resolver monitoring

Source: http://github.com/thorfi/nagios-bind9-plugin

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.


The check_bind9.pl plugin expects to run on the host running BIND.

Please run it with --help to see where it expects to find a variety of
files and commands, and the options you are likely to require to
provide.

The process the check_bind9.pl plugin goes through is:

1. Check for existence of file at --pid-path
   Return critical failure if missing/empty

2. Read the PID contents of file at --pid-path 
   Obtain a process list (either 'ps auxww' or 'ps -ef' depending on your OS).
   Return critical failure if PID is not in the process list

3. Execute 'rndc stats'  (--rndc-path --rndc-args stats)
   in order to generate the latest stats into --stats-path
   NOTE: You may need to a. configure BIND to dump statistics at a path
   b. configure something to regularly roll/truncate the stats file

4. open the file --stats-path, seek backwards --stats-seek bytes
   read the file and parse the last statistics block for the 
   numbers we are interested in for performance data.
   Return a warning if we cannot open and read the file, or do not
   find a statistics block.

5. Execute 'rndc status' (--rndc-path --rndc-args status)
   and parse its output for more performance data.
   Return a warning if we cannot find any status data.

6. Return status and any performance data.


The check_dns.pl plugin runs on the host you wish to send the queries
from, and expects to be given information on where to send queries to.

Please run it with --help to see the options you are required to
provide.

Unfortunately Perl does not provide a high resolution timer by default.
Please install the Perl module Time::HiRes somewhere that the plugin
script can find it.  If you do not, the time measurements will be
performed using select loops, and will be very inaccurate.

The process the check_dns.pl plugin goes through is:

1. Resolve IP address for --source-ip

2. Resolve IP address for --resolver

3, Repeat --tries times:

3.a. Form a query packet using --qname --qtype

3.b. Start timer, set up --timeout alarm

3.c. if --protocol is udp or tcpfallback

3.c.i. open a UDP socket bound to --source-ip (random port)
3.c.ii. Transmit query packet from the UDP socket to --resolver:53
3.c.iii. Await result

3.d. if --protocol is tcp or (tcpfallback and a truncated udp response occurred)
3.d.i. open a TCP socket bound to --source-ip (random port)
3.d.ii. connect TCP socket to --resolver:53
3.d.iii. Transmit query packet
3.d.iv. Await result

3.e. Once we recieve timeout alarm and/or result, end timer and store
     measurement.

4. Generate average time, compare against --warning and --critical
   to determine correct exit status.

5. Return exit status, average timing in milliseconds, and udp/tcp
   sent/received bytes and counts as performance data.

About

Nagios BIND9 Monitoring Plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published