monitoring-plugins/plugins
Christian Kujau 4195dc23d1 check_dig: use +retry instead of +tries
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>
2016-11-08 09:54:46 +01:00
..
t tests: enable snmp tests 2016-11-08 00:50:03 +01:00
tests GMT expiry display 2016-11-07 22:42:40 +01:00
check_apt.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_by_ssh.c check_by_ssh: print command output in verbose mode 2016-09-17 07:45:08 +02:00
check_cluster.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_dbi.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_dig.c check_dig: use +retry instead of +tries 2016-11-08 09:54:46 +01:00
check_disk.c Merge pull request #1312 from waja/check_disk_remove_unused_variables 2016-11-07 23:07:16 +01:00
check_dns.c Merge pull request #1307 from waja/check_dns_dead_code 2016-11-07 23:05:26 +01:00
check_dummy.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_fping.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_game.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_hpjd.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_http.c Merge branch 'pr/1373' 2015-10-06 12:57:29 +02:00
check_ide_smart.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_ldap.c Typo in check_ldap.c usage 2015-11-02 18:14:09 +01:00
check_load.c fix superfluous argument to printf (#fixes 1308) 2016-11-07 23:39:04 +01:00
check_mrtg.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_mrtgtraf.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_mysql.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_mysql_query.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_nagios.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_nt.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_ntp.c Merge pull request #1311 from waja/check_ntp_remove_unused_variables 2016-11-07 23:08:02 +01:00
check_ntp_peer.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_ntp_time.c Merge pull request #1313 from waja/check_ntp_time_remove_unused_variables 2016-11-07 23:06:38 +01:00
check_nwstat.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_overcr.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_pgsql.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_ping.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_procs.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_radius.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_real.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_smtp.c check_smtp.c: modified SSL check for use with -e 2015-10-08 09:04:29 +02:00
check_snmp.c Revert "check_snmp: fix push request 1173 for SNMP responses without datatype indicator" 2016-11-08 00:23:28 +01:00
check_ssh.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_swap.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_tcp.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_time.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_ups.c Merge branch 'maint' 2015-10-08 12:52:10 +02:00
check_users.c check_users: still allow zero thresholds 2016-11-07 21:49:03 +01:00
common.h Project rename initial commit. 2014-01-19 14:18:47 -05:00
Makefile.am Revert "Don't let check_disk hang on hanging file systems" 2015-10-12 11:07:02 +02:00
negate.c negate: remove unused variables 2014-12-15 19:42:33 +01:00
netutils.c Merge remote-tracking branch 'upstream/master' 2014-07-29 18:52:12 -04:00
netutils.h check_http: Allow for requesting TLSv1.1/TLSv1.2 2015-10-04 23:28:35 +02:00
popen.c Project rename initial commit. 2014-01-19 14:18:47 -05:00
popen.h Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
runcmd.c plugins/runcmd.c: Remove superfluous newline 2014-06-18 18:40:23 +02:00
runcmd.h Project rename initial commit. 2014-01-19 14:18:47 -05:00
sslutils.c GMT expiry display 2016-11-07 22:42:40 +01:00
urlize.c Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +01:00
utils.c check_users not correctly detecting thresholds 2016-11-07 21:36:25 +01:00
utils.h check_users not correctly detecting thresholds 2016-11-07 21:36:25 +01:00