summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2009-03-25 03:46:09 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2009-03-25 03:46:09 (GMT)
commitdd52d7e5e7acfd42243bc1ce173a0bf5d62fe347 (patch)
treea721972daa542584ba5ae2704734d30b27562fab
parent386b791af2a5c9d95531d2ca047dd8ffc12bcb2e (diff)
downloadmonitoring-plugins-dd52d7e5e7acfd42243bc1ce173a0bf5d62fe347.tar.gz
check_nt: allow returning UNKNOWN on timeouts (-u)
-rw-r--r--NEWS1
-rw-r--r--plugins/check_nt.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 4f3a833..e9e24a7 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ This file documents the major additions and syntax changes between releases.
29 Fixed negate not printing the real timeout in ALRM handler when left to default 29 Fixed negate not printing the real timeout in ALRM handler when left to default
30 negate timeout result is now configurable 30 negate timeout result is now configurable
31 Fixed segfault in check_mysql with old slaves (#2696823 - Oskar Ahner) 31 Fixed segfault in check_mysql with old slaves (#2696823 - Oskar Ahner)
32 check_nt can return UNKNOWN on timeouts (-u)
32 33
331.4.13 25th Sept 2008 341.4.13 25th Sept 2008
34 Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen) 35 Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen)
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 48bdccc..ec944e4 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -480,6 +480,7 @@ int process_arguments(int argc, char **argv){
480 {"params", required_argument,0,'l'}, 480 {"params", required_argument,0,'l'},
481 {"secret", required_argument,0,'s'}, 481 {"secret", required_argument,0,'s'},
482 {"display", required_argument,0,'d'}, 482 {"display", required_argument,0,'d'},
483 {"unknown-timeout", no_argument, 0, 'u'},
483 {"version", no_argument, 0,'V'}, 484 {"version", no_argument, 0,'V'},
484 {"help", no_argument, 0,'h'}, 485 {"help", no_argument, 0,'h'},
485 {0,0,0,0} 486 {0,0,0,0}
@@ -506,7 +507,7 @@ int process_arguments(int argc, char **argv){
506 } 507 }
507 508
508 while (1) { 509 while (1) {
509 c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",longopts,&option); 510 c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:u",longopts,&option);
510 511
511 if (c==-1||c==EOF||c==1) 512 if (c==-1||c==EOF||c==1)
512 break; 513 break;
@@ -574,6 +575,9 @@ int process_arguments(int argc, char **argv){
574 if (!strcmp(optarg,"SHOWALL")) 575 if (!strcmp(optarg,"SHOWALL"))
575 show_all = TRUE; 576 show_all = TRUE;
576 break; 577 break;
578 case 'u':
579 socket_timeout_state=STATE_UNKNOWN;
580 break;
577 case 't': /* timeout */ 581 case 't': /* timeout */
578 socket_timeout=atoi(optarg); 582 socket_timeout=atoi(optarg);
579 if(socket_timeout<=0) 583 if(socket_timeout<=0)
@@ -671,6 +675,8 @@ void print_help(void)
671 printf (" %s", _("Parameters passed to specified check (see below)")); 675 printf (" %s", _("Parameters passed to specified check (see below)"));
672 printf (" %s\n", "-d, --display={SHOWALL}"); 676 printf (" %s\n", "-d, --display={SHOWALL}");
673 printf (" %s", _("Display options (currently only SHOWALL works)")); 677 printf (" %s", _("Display options (currently only SHOWALL works)"));
678 printf (" %s\n", "-u, --unknown-timeout");
679 printf (" %s", _("Return UNKNOWN on timeouts"));
674 printf ("%d)\n", DEFAULT_SOCKET_TIMEOUT); 680 printf ("%d)\n", DEFAULT_SOCKET_TIMEOUT);
675 printf (" %s\n", "-h, --help"); 681 printf (" %s\n", "-h, --help");
676 printf (" %s\n", _("Print this help screen")); 682 printf (" %s\n", _("Print this help screen"));
@@ -754,6 +760,6 @@ void print_usage(void)
754{ 760{
755 printf (_("Usage:")); 761 printf (_("Usage:"));
756 printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname); 762 printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
757 printf ("[-l params] [-d SHOWALL] [-t timeout]\n"); 763 printf ("[-l params] [-d SHOWALL] [-u] [-t timeout]\n");
758} 764}
759 765