mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-26 16:48:09 -04:00
After upgrading from an Ubuntu/15.10 to 16.04 installation, I noticed that
check_dig is always returning a WARNING:
$ /usr/lib/nagios/plugins/check_dig -l localhost -v
/usr/bin/dig -p 53 @127.0.0.1 localhost A +tries=3 +time=6
Looking for: 'localhost'
DNS WARNING - 0.008 seconds response time (dig returned an error status)|time=0.008274s;;;0.000000
The older Ubuntu installation got its check_dig from the
nagios-plugins-standard package[0] which did not include the +tries
option. The current Ubuntu version provides its check_dig from the
monitoring-plugins-standard package[1], which _does_ use the +tries
option that was introduced with df53473[2].
On my system, it so happens that /usr/bin/dig is provided not by the
(BIND) dnsutils package but by knot-dnsutils[3] from the Knot DNS project.
The Knot dig(1) command doesn't support the +tries option[4] but does
support +retry (which is also supported[5] by the BIND dig(1) command).
One way to fix that would be for me to install the BIND dnsutils package. But I did not
want to do that: it's so much larger in size and pulls in much more dependencies
than the knot-dnsutils package.
The patch below changes check_dig to use +retry instead of +tries. Both
options are similar, but not the same:
+retry - Sets the number of times to retry UDP queries to server to T
instead of the default, 2. Unlike +tries, this does not include
the initial query
As number_tries seems to be hard coded to 3, I've lowered DEFAULT_TRIES to
2 so check_dig should behave as before (with +tries=3).
Thanks,
Christian.
[0] http://packages.ubuntu.com/wily/nagios-plugins-standard
[1] http://packages.ubuntu.com/xenial/monitoring-plugins-standard
[2] https://github.com/monitoring-plugins/monitoring-plugins/commit/df53473
[3] http://packages.ubuntu.com/xenial/knot-dnsutils
[4] https://www.knot-dns.cz/docs/2.x/html/man_kdig.html#notes
[5] https://ftp.isc.org/isc/bind9/cur/9.10/doc/arm/man.dig.html
Signed-off-by: Christian Kujau <lists@nerdbynature.de>
|
||
|---|---|---|
| .. | ||
| t | ||
| tests | ||
| check_apt.c | ||
| check_by_ssh.c | ||
| check_cluster.c | ||
| check_dbi.c | ||
| check_dig.c | ||
| check_disk.c | ||
| check_dns.c | ||
| check_dummy.c | ||
| check_fping.c | ||
| check_game.c | ||
| check_hpjd.c | ||
| check_http.c | ||
| check_ide_smart.c | ||
| check_ldap.c | ||
| check_load.c | ||
| check_mrtg.c | ||
| check_mrtgtraf.c | ||
| check_mysql.c | ||
| check_mysql_query.c | ||
| check_nagios.c | ||
| check_nt.c | ||
| check_ntp.c | ||
| check_ntp_peer.c | ||
| check_ntp_time.c | ||
| check_nwstat.c | ||
| check_overcr.c | ||
| check_pgsql.c | ||
| check_ping.c | ||
| check_procs.c | ||
| check_radius.c | ||
| check_real.c | ||
| check_smtp.c | ||
| check_snmp.c | ||
| check_ssh.c | ||
| check_swap.c | ||
| check_tcp.c | ||
| check_time.c | ||
| check_ups.c | ||
| check_users.c | ||
| common.h | ||
| Makefile.am | ||
| negate.c | ||
| netutils.c | ||
| netutils.h | ||
| popen.c | ||
| popen.h | ||
| runcmd.c | ||
| runcmd.h | ||
| sslutils.c | ||
| urlize.c | ||
| utils.c | ||
| utils.h | ||