From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- ...606-nagios-plugins-1.4.11-check_dig_fix-1.patch | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 web/attachments/265606-nagios-plugins-1.4.11-check_dig_fix-1.patch (limited to 'web/attachments/265606-nagios-plugins-1.4.11-check_dig_fix-1.patch') diff --git a/web/attachments/265606-nagios-plugins-1.4.11-check_dig_fix-1.patch b/web/attachments/265606-nagios-plugins-1.4.11-check_dig_fix-1.patch new file mode 100644 index 0000000..d1a3516 --- /dev/null +++ b/web/attachments/265606-nagios-plugins-1.4.11-check_dig_fix-1.patch @@ -0,0 +1,48 @@ +Date: 07 Feburary 2008 +Author: Jethro Carr working for Prophecy Networks NZ. +Details: Fixed check_dig plugin to make the dig command in the backend run for the specified time period. + +--- nagios-plugins-1.4.1/plugins/check_dig.c 2005-01-27 10:21:01.000000000 +1300 +--- nagios-plugins-1.4.11.orig/plugins/check_dig.c 2007-01-29 10:46:41.000000000 +1300 ++++ nagios-plugins-1.4.11/plugins/check_dig.c 2008-02-07 10:59:46.000000000 +1300 +@@ -54,6 +54,8 @@ + + #define UNDEFINED 0 + #define DEFAULT_PORT 53 ++#define DEFAULT_TRIES 3 ++#define DEFAULT_TIMEOUT 10 + + char *query_address = NULL; + char *record_type = "A"; +@@ -61,6 +63,7 @@ + char *dns_server = NULL; + int verbose = FALSE; + int server_port = DEFAULT_PORT; ++int number_tries = DEFAULT_TRIES; + double warning_interval = UNDEFINED; + double critical_interval = UNDEFINED; + struct timeval tv; +@@ -76,6 +79,7 @@ + long microsec; + double elapsed_time; + int result = STATE_UNKNOWN; ++ timeout_interval = DEFAULT_TIMEOUT; + + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); +@@ -88,9 +92,13 @@ + if (process_arguments (argc, argv) == ERROR) + usage_va(_("Could not parse arguments")); + ++ /* dig applies the timeout to each try, so we need to work around this */ ++ int timeout_interval_dig = ceil((double) timeout_interval / (double) number_tries); ++ + /* get the command to run */ +- asprintf (&command_line, "%s @%s -p %d %s -t %s", +- PATH_TO_DIG, dns_server, server_port, query_address, record_type); ++ asprintf (&command_line, "%s @%s -p %d %s -t %s +tries=%d +time=%d", ++ PATH_TO_DIG, dns_server, server_port, query_address, record_type, number_tries, timeout_interval_dig); ++ + + alarm (timeout_interval); + gettimeofday (&tv, NULL); -- cgit v1.2.3-74-g34f1