aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_nt.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@aei.ca> 2009-03-24 23:46:09 -0400
committerGravatar Thomas Guyot-Sionnest <dermoth@aei.ca> 2009-03-24 23:46:09 -0400
commitdd52d7e5e7acfd42243bc1ce173a0bf5d62fe347 (patch)
treea721972daa542584ba5ae2704734d30b27562fab /plugins/check_nt.c
parent386b791af2a5c9d95531d2ca047dd8ffc12bcb2e (diff)
downloadmonitoring-plugins-dd52d7e5e7acfd42243bc1ce173a0bf5d62fe347.tar.gz
check_nt: allow returning UNKNOWN on timeouts (-u)
Diffstat (limited to 'plugins/check_nt.c')
-rw-r--r--plugins/check_nt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 48bdcccd..ec944e4c 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -480,6 +480,7 @@ int process_arguments(int argc, char **argv){
{"params", required_argument,0,'l'},
{"secret", required_argument,0,'s'},
{"display", required_argument,0,'d'},
+ {"unknown-timeout", no_argument, 0, 'u'},
{"version", no_argument, 0,'V'},
{"help", no_argument, 0,'h'},
{0,0,0,0}
@@ -506,7 +507,7 @@ int process_arguments(int argc, char **argv){
}
while (1) {
- c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",longopts,&option);
+ c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:u",longopts,&option);
if (c==-1||c==EOF||c==1)
break;
@@ -574,6 +575,9 @@ int process_arguments(int argc, char **argv){
if (!strcmp(optarg,"SHOWALL"))
show_all = TRUE;
break;
+ case 'u':
+ socket_timeout_state=STATE_UNKNOWN;
+ break;
case 't': /* timeout */
socket_timeout=atoi(optarg);
if(socket_timeout<=0)
@@ -671,6 +675,8 @@ void print_help(void)
printf (" %s", _("Parameters passed to specified check (see below)"));
printf (" %s\n", "-d, --display={SHOWALL}");
printf (" %s", _("Display options (currently only SHOWALL works)"));
+ printf (" %s\n", "-u, --unknown-timeout");
+ printf (" %s", _("Return UNKNOWN on timeouts"));
printf ("%d)\n", DEFAULT_SOCKET_TIMEOUT);
printf (" %s\n", "-h, --help");
printf (" %s\n", _("Print this help screen"));
@@ -754,6 +760,6 @@ void print_usage(void)
{
printf (_("Usage:"));
printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
- printf ("[-l params] [-d SHOWALL] [-t timeout]\n");
+ printf ("[-l params] [-d SHOWALL] [-u] [-t timeout]\n");
}