summaryrefslogtreecommitdiffstats
path: root/plugins/negate.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/negate.c')
-rw-r--r--plugins/negate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/negate.c b/plugins/negate.c
index e8be83d7..ebbb1523 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -130,6 +130,7 @@ process_arguments (int argc, char **argv)
130 {"help", no_argument, 0, 'h'}, 130 {"help", no_argument, 0, 'h'},
131 {"version", no_argument, 0, 'V'}, 131 {"version", no_argument, 0, 'V'},
132 {"timeout", required_argument, 0, 't'}, 132 {"timeout", required_argument, 0, 't'},
133 {"timeout-result", required_argument, 0, 'T'},
133 {"ok", required_argument, 0, 'o'}, 134 {"ok", required_argument, 0, 'o'},
134 {"warning", required_argument, 0, 'w'}, 135 {"warning", required_argument, 0, 'w'},
135 {"critical", required_argument, 0, 'c'}, 136 {"critical", required_argument, 0, 'c'},
@@ -139,7 +140,7 @@ process_arguments (int argc, char **argv)
139 }; 140 };
140 141
141 while (1) { 142 while (1) {
142 c = getopt_long (argc, argv, "+hVt:o:w:c:u:s", longopts, &option); 143 c = getopt_long (argc, argv, "+hVt:T:o:w:c:u:s", longopts, &option);
143 144
144 if (c == -1 || c == EOF) 145 if (c == -1 || c == EOF)
145 break; 146 break;
@@ -161,6 +162,10 @@ process_arguments (int argc, char **argv)
161 else 162 else
162 timeout_interval = atoi (optarg); 163 timeout_interval = atoi (optarg);
163 break; 164 break;
165 case 'T': /* Result to return on timeouts */
166 if ((timeout_state = translate_state(optarg)) == ERROR)
167 usage4 (_("timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
168 break;
164 case 'o': /* replacement for OK */ 169 case 'o': /* replacement for OK */
165 if ((state[STATE_OK] = translate_state(optarg)) == ERROR) 170 if ((state[STATE_OK] = translate_state(optarg)) == ERROR)
166 usage4 (_("Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3).")); 171 usage4 (_("Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
@@ -246,6 +251,8 @@ print_help (void)
246 251
247 printf (_(UT_TIMEOUT), timeout_interval); 252 printf (_(UT_TIMEOUT), timeout_interval);
248 printf (" %s\n", _("Keep timeout longer than the plugin timeout to retain CRITICAL status.")); 253 printf (" %s\n", _("Keep timeout longer than the plugin timeout to retain CRITICAL status."));
254 printf (" -T, --timeout-result=STATUS\n");
255 printf (" %s\n", _("Custom result on Negate timeouts; see below for STATUS definition\n"));
249 256
250 printf(" -o, --ok=STATUS\n"); 257 printf(" -o, --ok=STATUS\n");
251 printf(" -w, --warning=STATUS\n"); 258 printf(" -w, --warning=STATUS\n");
@@ -270,6 +277,9 @@ print_help (void)
270 printf (" %s\n", _("If the wrapped plugin returns OK, the wrapper will return CRITICAL.")); 277 printf (" %s\n", _("If the wrapped plugin returns OK, the wrapper will return CRITICAL."));
271 printf (" %s\n", _("If the wrapped plugin returns CRITICAL, the wrapper will return OK.")); 278 printf (" %s\n", _("If the wrapped plugin returns CRITICAL, the wrapper will return OK."));
272 printf (" %s\n", _("Otherwise, the output state of the wrapped plugin is unchanged.")); 279 printf (" %s\n", _("Otherwise, the output state of the wrapped plugin is unchanged."));
280 printf ("\n");
281 printf (" %s\n", _("Using timeout-result, it is possible to override the timeout behaviour or a"));
282 printf (" %s\n", _("plugin by setting the negate timeout a bit lower."));
273 283
274 printf (_(UT_SUPPORT)); 284 printf (_(UT_SUPPORT));
275} 285}
@@ -280,5 +290,5 @@ void
280print_usage (void) 290print_usage (void)
281{ 291{
282 printf (_("Usage:")); 292 printf (_("Usage:"));
283 printf ("%s [-t timeout] [-owcu STATE] [-s] <definition of wrapped plugin>\n", progname); 293 printf ("%s [-t timeout] [-Towcu STATE] [-s] <definition of wrapped plugin>\n", progname);
284} 294}