summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-05-07 10:02:42 (GMT)
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-05-07 10:02:42 (GMT)
commit44f8455b2cf248c6f50c35bfc3510d2946084c5b (patch)
tree26b696c5d61872f1d41466be9fcc650c22d75aeb
parent4d157889e3018119e07bdcc7f48afde1422f7396 (diff)
downloadmonitoring-plugins-44f8455b2cf248c6f50c35bfc3510d2946084c5b.tar.gz
Added support for --extra-opts in all C plugins (disabled by default, see configure --help)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins-root/check_dhcp.c10
-rw-r--r--plugins-root/check_icmp.c9
-rw-r--r--plugins/check_apt.c10
-rw-r--r--plugins/check_by_ssh.c11
-rw-r--r--plugins/check_cluster.c8
-rw-r--r--plugins/check_dig.c13
-rw-r--r--plugins/check_disk.c11
-rw-r--r--plugins/check_dns.c11
-rw-r--r--plugins/check_fping.c11
-rw-r--r--plugins/check_game.c8
-rw-r--r--plugins/check_hpjd.c20
-rw-r--r--plugins/check_http.c13
-rw-r--r--plugins/check_ide_smart.c11
-rw-r--r--plugins/check_ldap.c17
-rw-r--r--plugins/check_load.c10
-rw-r--r--plugins/check_mrtg.c7
-rw-r--r--plugins/check_mrtgtraf.c7
-rw-r--r--plugins/check_mysql.c10
-rw-r--r--plugins/check_mysql_query.c10
-rw-r--r--plugins/check_nagios.c11
-rw-r--r--plugins/check_nt.c9
-rw-r--r--plugins/check_ntp.c9
-rw-r--r--plugins/check_ntp_peer.c14
-rw-r--r--plugins/check_ntp_time.c15
-rw-r--r--plugins/check_nwstat.c7
-rw-r--r--plugins/check_overcr.c21
-rw-r--r--plugins/check_pgsql.c10
-rw-r--r--plugins/check_ping.c10
-rw-r--r--plugins/check_procs.c17
-rw-r--r--plugins/check_radius.c10
-rw-r--r--plugins/check_real.c10
-rw-r--r--plugins/check_smtp.c10
-rw-r--r--plugins/check_snmp.c7
-rw-r--r--plugins/check_ssh.c10
-rw-r--r--plugins/check_swap.c9
-rw-r--r--plugins/check_tcp.c10
-rw-r--r--plugins/check_time.c11
-rw-r--r--plugins/check_ups.c9
-rw-r--r--plugins/check_users.c10
-rw-r--r--plugins/utils.h19
40 files changed, 415 insertions, 30 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index 9b62b3e..241f13e 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -268,6 +268,9 @@ int main(int argc, char **argv){
268 bindtextdomain (PACKAGE, LOCALEDIR); 268 bindtextdomain (PACKAGE, LOCALEDIR);
269 textdomain (PACKAGE); 269 textdomain (PACKAGE);
270 270
271 /* Parse extra opts if any */
272 argv=np_extra_opts(&argc, argv, progname);
273
271 if(process_arguments(argc,argv)!=OK){ 274 if(process_arguments(argc,argv)!=OK){
272 usage4 (_("Could not parse arguments")); 275 usage4 (_("Could not parse arguments"));
273 } 276 }
@@ -1395,6 +1398,7 @@ void print_help(void){
1395 print_usage(); 1398 print_usage();
1396 1399
1397 printf (_(UT_HELP_VRSN)); 1400 printf (_(UT_HELP_VRSN));
1401 printf (_(UT_EXTRA_OPTS));
1398 1402
1399 printf (_(UT_VERBOSE)); 1403 printf (_(UT_VERBOSE));
1400 1404
@@ -1411,6 +1415,12 @@ void print_help(void){
1411 printf (" %s\n", "-u, --unicast"); 1415 printf (" %s\n", "-u, --unicast");
1412 printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s")); 1416 printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
1413 1417
1418#ifdef NP_EXTRA_OPTS
1419 printf ("\n");
1420 printf ("%s\n", _("Notes:"));
1421 printf (_(UT_EXTRA_OPTS_NOTES));
1422#endif
1423
1414 printf (_(UT_SUPPORT)); 1424 printf (_(UT_SUPPORT));
1415 return; 1425 return;
1416 } 1426 }
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index a059f26..f3e5f0d 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -447,6 +447,9 @@ main(int argc, char **argv)
447 packets = 5; 447 packets = 5;
448 } 448 }
449 449
450 /* Parse extra opts if any */
451 argv=np_extra_opts(&argc, argv, progname);
452
450 /* parse the arguments */ 453 /* parse the arguments */
451 for(i = 1; i < argc; i++) { 454 for(i = 1; i < argc; i++) {
452 while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) { 455 while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) {
@@ -1262,6 +1265,7 @@ print_help(void)
1262 print_usage (); 1265 print_usage ();
1263 1266
1264 printf (_(UT_HELP_VRSN)); 1267 printf (_(UT_HELP_VRSN));
1268 printf (_(UT_EXTRA_OPTS));
1265 1269
1266 printf (" %s\n", "-H"); 1270 printf (" %s\n", "-H");
1267 printf (" %s\n", _("specify a target")); 1271 printf (" %s\n", _("specify a target"));
@@ -1310,10 +1314,13 @@ print_help(void)
1310 printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/ 1314 printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/
1311 printf ("\n"); 1315 printf ("\n");
1312 printf (" %s\n", _("The -v switch can be specified several times for increased verbosity.")); 1316 printf (" %s\n", _("The -v switch can be specified several times for increased verbosity."));
1313
1314/* printf ("%s\n", _("Long options are currently unsupported.")); 1317/* printf ("%s\n", _("Long options are currently unsupported."));
1315 printf ("%s\n", _("Options marked with * require an argument")); 1318 printf ("%s\n", _("Options marked with * require an argument"));
1316*/ 1319*/
1320#ifdef NP_EXTRA_OPTS
1321 printf ("\n");
1322 printf (_(UT_EXTRA_OPTS_NOTES));
1323#endif
1317 1324
1318 printf (_(UT_SUPPORT)); 1325 printf (_(UT_SUPPORT));
1319} 1326}
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index bd59c70..440755d 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -88,6 +88,9 @@ static int exec_warning = 0; /* if a cmd exited non-zero */
88int main (int argc, char **argv) { 88int main (int argc, char **argv) {
89 int result=STATE_UNKNOWN, packages_available=0, sec_count=0; 89 int result=STATE_UNKNOWN, packages_available=0, sec_count=0;
90 90
91 /* Parse extra opts if any */
92 argv=np_extra_opts(&argc, argv, progname);
93
91 if (process_arguments(argc, argv) == ERROR) 94 if (process_arguments(argc, argv) == ERROR)
92 usage_va(_("Could not parse arguments")); 95 usage_va(_("Could not parse arguments"));
93 96
@@ -414,6 +417,7 @@ print_help (void)
414 print_usage(); 417 print_usage();
415 418
416 printf(_(UT_HELP_VRSN)); 419 printf(_(UT_HELP_VRSN));
420 printf(_(UT_EXTRA_OPTS));
417 421
418 printf(_(UT_TIMEOUT), timeout_interval); 422 printf(_(UT_TIMEOUT), timeout_interval);
419 423
@@ -454,6 +458,12 @@ print_help (void)
454 printf (" %s\n", _("timeout (with -t) to prevent the plugin from timing out if apt-get")); 458 printf (" %s\n", _("timeout (with -t) to prevent the plugin from timing out if apt-get"));
455 printf (" %s\n", _("upgrade is expected to take longer than the default timeout.")); 459 printf (" %s\n", _("upgrade is expected to take longer than the default timeout."));
456 460
461#ifdef NP_EXTRA_OPTS
462 printf("\n");
463 printf("%s\n", _("Notes:"));
464 printf(_(UT_EXTRA_OPTS_NOTES));
465#endif
466
457 printf(_(UT_SUPPORT)); 467 printf(_(UT_SUPPORT));
458} 468}
459 469
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 37874bf..9def404 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -76,6 +76,9 @@ main (int argc, char **argv)
76 bindtextdomain (PACKAGE, LOCALEDIR); 76 bindtextdomain (PACKAGE, LOCALEDIR);
77 textdomain (PACKAGE); 77 textdomain (PACKAGE);
78 78
79 /* Parse extra opts if any */
80 argv=np_extra_opts (&argc, argv, progname);
81
79 /* process arguments */ 82 /* process arguments */
80 if (process_arguments (argc, argv) == ERROR) 83 if (process_arguments (argc, argv) == ERROR)
81 usage_va(_("Could not parse arguments")); 84 usage_va(_("Could not parse arguments"));
@@ -350,6 +353,8 @@ print_help (void)
350 353
351 printf (_(UT_HELP_VRSN)); 354 printf (_(UT_HELP_VRSN));
352 355
356 printf (_(UT_EXTRA_OPTS));
357
353 printf (_(UT_HOST_PORT), 'p', "none"); 358 printf (_(UT_HOST_PORT), 'p', "none");
354 359
355 printf (_(UT_IPv46)); 360 printf (_(UT_IPv46));
@@ -402,6 +407,12 @@ print_help (void)
402 printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days"); 407 printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days");
403 printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days"); 408 printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days");
404 409
410#ifdef NP_EXTRA_OPTS
411 printf("\n");
412 printf("%s\n", _("Notes:"));
413 printf(_(UT_EXTRA_OPTS_NOTES));
414#endif
415
405 printf(_(UT_SUPPORT)); 416 printf(_(UT_SUPPORT));
406} 417}
407 418
diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c
index ac3eece..d493149 100644
--- a/plugins/check_cluster.c
+++ b/plugins/check_cluster.c
@@ -74,6 +74,9 @@ int main(int argc, char **argv){
74 bindtextdomain (PACKAGE, LOCALEDIR); 74 bindtextdomain (PACKAGE, LOCALEDIR);
75 textdomain (PACKAGE); 75 textdomain (PACKAGE);
76 76
77 /* Parse extra opts if any */
78 argv=np_extra_opts(&argc, argv, progname);
79
77 if(process_arguments(argc,argv)==ERROR) 80 if(process_arguments(argc,argv)==ERROR)
78 usage(_("Could not parse arguments")); 81 usage(_("Could not parse arguments"));
79 82
@@ -236,6 +239,7 @@ print_help(void)
236 239
237 printf("\n"); 240 printf("\n");
238 printf("%s\n", _("Options:")); 241 printf("%s\n", _("Options:"));
242 printf(_(UT_EXTRA_OPTS));
239 printf (" %s\n", "-s, --service"); 243 printf (" %s\n", "-s, --service");
240 printf (" %s\n", _("Check service cluster status")); 244 printf (" %s\n", _("Check service cluster status"));
241 printf (" %s\n", "-h, --host"); 245 printf (" %s\n", "-h, --host");
@@ -257,6 +261,10 @@ print_help(void)
257 printf("\n"); 261 printf("\n");
258 printf("%s\n", _("Notes:")); 262 printf("%s\n", _("Notes:"));
259 printf(_(UT_THRESHOLDS_NOTES)); 263 printf(_(UT_THRESHOLDS_NOTES));
264#ifdef NP_EXTRA_OPTS
265 printf ("\n");
266 printf (_(UT_EXTRA_OPTS_NOTES));
267#endif
260 268
261 printf(_(UT_SUPPORT)); 269 printf(_(UT_SUPPORT));
262} 270}
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index d7e1f57..e3f7adb 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -84,6 +84,9 @@ main (int argc, char **argv)
84 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) 84 if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR)
85 usage_va(_("Cannot catch SIGALRM")); 85 usage_va(_("Cannot catch SIGALRM"));
86 86
87 /* Parse extra opts if any */
88 argv=np_extra_opts (&argc, argv, progname);
89
87 if (process_arguments (argc, argv) == ERROR) 90 if (process_arguments (argc, argv) == ERROR)
88 usage_va(_("Could not parse arguments")); 91 usage_va(_("Could not parse arguments"));
89 92
@@ -317,6 +320,8 @@ print_help (void)
317 320
318 printf (_(UT_HELP_VRSN)); 321 printf (_(UT_HELP_VRSN));
319 322
323 printf (_(UT_EXTRA_OPTS));
324
320 printf (_(UT_HOST_PORT), 'p', myport); 325 printf (_(UT_HOST_PORT), 'p', myport);
321 326
322 printf (" %s\n","-l, --query_address=STRING"); 327 printf (" %s\n","-l, --query_address=STRING");
@@ -332,11 +337,17 @@ print_help (void)
332 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); 337 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
333 printf (_(UT_VERBOSE)); 338 printf (_(UT_VERBOSE));
334 339
335 printf("\n"); 340 printf ("\n");
336 printf ("%s\n", _("Examples:")); 341 printf ("%s\n", _("Examples:"));
337 printf (" %s\n", "check_dig -H DNSSERVER -l www.example.com -A \"+tcp\""); 342 printf (" %s\n", "check_dig -H DNSSERVER -l www.example.com -A \"+tcp\"");
338 printf (" %s\n", "This will send a tcp query to DNSSERVER for www.example.com"); 343 printf (" %s\n", "This will send a tcp query to DNSSERVER for www.example.com");
339 344
345#ifdef NP_EXTRA_OPTS
346 printf ("\n");
347 printf ("%s\n", _("Notes:"));
348 printf (_(UT_EXTRA_OPTS_NOTES));
349#endif
350
340 printf (_(UT_SUPPORT)); 351 printf (_(UT_SUPPORT));
341} 352}
342 353
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 7048a56..e9e7219 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -192,6 +192,9 @@ main (int argc, char **argv)
192 192
193 mount_list = read_file_system_list (0); 193 mount_list = read_file_system_list (0);
194 194
195 /* Parse extra opts if any */
196 argv = np_extra_opts (&argc, argv, progname);
197
195 if (process_arguments (argc, argv) == ERROR) 198 if (process_arguments (argc, argv) == ERROR)
196 usage4 (_("Could not parse arguments")); 199 usage4 (_("Could not parse arguments"));
197 200
@@ -903,6 +906,7 @@ print_help (void)
903 print_usage (); 906 print_usage ();
904 907
905 printf (_(UT_HELP_VRSN)); 908 printf (_(UT_HELP_VRSN));
909 printf (_(UT_EXTRA_OPTS));
906 910
907 printf (" %s\n", "-w, --warning=INTEGER"); 911 printf (" %s\n", "-w, --warning=INTEGER");
908 printf (" %s\n", _("Exit with WARNING status if less than INTEGER units of disk are free")); 912 printf (" %s\n", _("Exit with WARNING status if less than INTEGER units of disk are free"));
@@ -955,6 +959,13 @@ print_help (void)
955 printf (_(UT_VERBOSE)); 959 printf (_(UT_VERBOSE));
956 printf (" %s\n", "-X, --exclude-type=TYPE"); 960 printf (" %s\n", "-X, --exclude-type=TYPE");
957 printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)")); 961 printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)"));
962
963#ifdef NP_EXTRA_OPTS
964 printf ("\n");
965 printf ("%s\n", _("Notes:"));
966 printf (_(UT_EXTRA_OPTS_NOTES));
967#endif
968
958 printf ("\n"); 969 printf ("\n");
959 printf ("%s\n", _("Examples:")); 970 printf ("%s\n", _("Examples:"));
960 printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /"); 971 printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /");
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index f8dbb4d..1384064 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -99,6 +99,9 @@ main (int argc, char **argv)
99 usage_va(_("Cannot catch SIGALRM")); 99 usage_va(_("Cannot catch SIGALRM"));
100 } 100 }
101 101
102 /* Parse extra opts if any */
103 argv=np_extra_opts (&argc, argv, progname);
104
102 if (process_arguments (argc, argv) == ERROR) { 105 if (process_arguments (argc, argv) == ERROR) {
103 usage_va(_("Could not parse arguments")); 106 usage_va(_("Could not parse arguments"));
104 } 107 }
@@ -457,6 +460,7 @@ print_help (void)
457 print_usage (); 460 print_usage ();
458 461
459 printf (_(UT_HELP_VRSN)); 462 printf (_(UT_HELP_VRSN));
463 printf (_(UT_EXTRA_OPTS));
460 464
461 printf (" -H, --hostname=HOST\n"); 465 printf (" -H, --hostname=HOST\n");
462 printf (" %s\n", _("The name or address you want to query")); 466 printf (" %s\n", _("The name or address you want to query"));
@@ -475,6 +479,13 @@ print_help (void)
475 printf (" %s\n", _("Return critical if elapsed time exceeds value. Default off")); 479 printf (" %s\n", _("Return critical if elapsed time exceeds value. Default off"));
476 480
477 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); 481 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
482
483#ifdef NP_EXTRA_OPTS
484 printf ("\n");
485 printf ("%s\n", _("Notes:"));
486 printf (_(UT_EXTRA_OPTS_NOTES));
487#endif
488
478 printf (_(UT_SUPPORT)); 489 printf (_(UT_SUPPORT));
479} 490}
480 491
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 8617871..5a0ab8c 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -83,6 +83,9 @@ main (int argc, char **argv)
83 bindtextdomain (PACKAGE, LOCALEDIR); 83 bindtextdomain (PACKAGE, LOCALEDIR);
84 textdomain (PACKAGE); 84 textdomain (PACKAGE);
85 85
86 /* Parse extra opts if any */
87 argv=np_extra_opts (&argc, argv, progname);
88
86 if (process_arguments (argc, argv) == ERROR) 89 if (process_arguments (argc, argv) == ERROR)
87 usage4 (_("Could not parse arguments")); 90 usage4 (_("Could not parse arguments"));
88 91
@@ -379,6 +382,7 @@ print_help (void)
379 print_usage (); 382 print_usage ();
380 383
381 printf (_(UT_HELP_VRSN)); 384 printf (_(UT_HELP_VRSN));
385 printf (_(UT_EXTRA_OPTS));
382 386
383 printf (" %s\n", "-H, --hostname=HOST"); 387 printf (" %s\n", "-H, --hostname=HOST");
384 printf (" %s\n", _("name or IP Address of host to ping (IP Address bypasses name lookup, reducing system load)")); 388 printf (" %s\n", _("name or IP Address of host to ping (IP Address bypasses name lookup, reducing system load)"));
@@ -395,6 +399,13 @@ print_help (void)
395 printf (" %s\n", _("THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time (ms)")); 399 printf (" %s\n", _("THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time (ms)"));
396 printf (" %s\n", _("which triggers a WARNING or CRITICAL state, and <pl> is the percentage of")); 400 printf (" %s\n", _("which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"));
397 printf (" %s\n", _("packet loss to trigger an alarm state.")); 401 printf (" %s\n", _("packet loss to trigger an alarm state."));
402
403#ifdef NP_EXTRA_OPTS
404 printf ("\n");
405 printf ("%s\n", _("Notes:"));
406 printf (_(UT_EXTRA_OPTS_NOTES));
407#endif
408
398 printf (_(UT_SUPPORT)); 409 printf (_(UT_SUPPORT));
399} 410}
400 411
diff --git a/plugins/check_game.c b/plugins/check_game.c
index 0e4120d..4bc57c8 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -79,6 +79,9 @@ main (int argc, char **argv)
79 bindtextdomain (PACKAGE, LOCALEDIR); 79 bindtextdomain (PACKAGE, LOCALEDIR);
80 textdomain (PACKAGE); 80 textdomain (PACKAGE);
81 81
82 /* Parse extra opts if any */
83 argv=np_extra_opts (&argc, argv, progname);
84
82 if (process_arguments (argc, argv) == ERROR) 85 if (process_arguments (argc, argv) == ERROR)
83 usage_va(_("Could not parse arguments")); 86 usage_va(_("Could not parse arguments"));
84 87
@@ -302,6 +305,7 @@ print_help (void)
302 print_usage (); 305 print_usage ();
303 306
304 printf (_(UT_HELP_VRSN)); 307 printf (_(UT_HELP_VRSN));
308 printf (_(UT_EXTRA_OPTS));
305 309
306 printf (" %s\n", "-p"); 310 printf (" %s\n", "-p");
307 printf (" %s\n", _("Optional port of which to connect")); 311 printf (" %s\n", _("Optional port of which to connect"));
@@ -319,6 +323,10 @@ print_help (void)
319 printf (" %s\n", _("This plugin uses the 'qstat' command, the popular game server status query tool.")); 323 printf (" %s\n", _("This plugin uses the 'qstat' command, the popular game server status query tool."));
320 printf (" %s\n", _("If you don't have the package installed, you will need to download it from")); 324 printf (" %s\n", _("If you don't have the package installed, you will need to download it from"));
321 printf (" %s\n", _("http://www.activesw.com/people/steve/qstat.html before you can use this plugin.")); 325 printf (" %s\n", _("http://www.activesw.com/people/steve/qstat.html before you can use this plugin."));
326#ifdef NP_EXTRA_OPTS
327 printf ("\n");
328 printf (_(UT_EXTRA_OPTS_NOTES));
329#endif
322 330
323 printf (_(UT_SUPPORT)); 331 printf (_(UT_SUPPORT));
324} 332}
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index e20a76d..044f08f 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -100,6 +100,9 @@ main (int argc, char **argv)
100 bindtextdomain (PACKAGE, LOCALEDIR); 100 bindtextdomain (PACKAGE, LOCALEDIR);
101 textdomain (PACKAGE); 101 textdomain (PACKAGE);
102 102
103 /* Parse extra opts if any */
104 argv=np_extra_opts (&argc, argv, progname);
105
103 if (process_arguments (argc, argv) == ERROR) 106 if (process_arguments (argc, argv) == ERROR)
104 usage4 (_("Could not parse arguments")); 107 usage4 (_("Could not parse arguments"));
105 108
@@ -390,19 +393,26 @@ print_help (void)
390 printf (COPYRIGHT, copyright, email); 393 printf (COPYRIGHT, copyright, email);
391 394
392 printf ("%s\n", _("This plugin tests the STATUS of an HP printer with a JetDirect card.")); 395 printf ("%s\n", _("This plugin tests the STATUS of an HP printer with a JetDirect card."));
393 printf ("%s\n", _("Net-snmp must be installed on the computer running the plugin.")); 396 printf ("%s\n", _("Net-snmp must be installed on the computer running the plugin."));
394 397
395 printf ("\n\n"); 398 printf ("\n\n");
396 399
397 print_usage (); 400 print_usage ();
398 401
399 printf (_(UT_HELP_VRSN)); 402 printf (_(UT_HELP_VRSN));
403 printf (_(UT_EXTRA_OPTS));
400 404
401 printf (" %s\n", "-C, --community=STRING"); 405 printf (" %s\n", "-C, --community=STRING");
402 printf (" %s", _("The SNMP community name ")); 406 printf (" %s", _("The SNMP community name "));
403 printf (_("(default=%s)"), DEFAULT_COMMUNITY); 407 printf (_("(default=%s)"), DEFAULT_COMMUNITY);
408 printf ("\n");
409
410#ifdef NP_EXTRA_OPTS
411 printf ("\n");
412 printf ("%s\n", _("Notes:"));
413 printf (_(UT_EXTRA_OPTS_NOTES));
414#endif
404 415
405 printf ("\n");
406 printf (_(UT_SUPPORT)); 416 printf (_(UT_SUPPORT));
407} 417}
408 418
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 81071d7..42636cd 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -147,6 +147,9 @@ main (int argc, char **argv)
147 asprintf (&user_agent, "User-Agent: check_http/%s (nagios-plugins %s)", 147 asprintf (&user_agent, "User-Agent: check_http/%s (nagios-plugins %s)",
148 clean_revstring (revision), VERSION); 148 clean_revstring (revision), VERSION);
149 149
150 /* Parse extra opts if any */
151 argv=np_extra_opts (&argc, argv, progname);
152
150 if (process_arguments (argc, argv) == ERROR) 153 if (process_arguments (argc, argv) == ERROR)
151 usage4 (_("Could not parse arguments")); 154 usage4 (_("Could not parse arguments"));
152 155
@@ -1232,6 +1235,7 @@ print_help (void)
1232 printf ("\n"); 1235 printf ("\n");
1233 1236
1234 printf (_(UT_HELP_VRSN)); 1237 printf (_(UT_HELP_VRSN));
1238 printf (_(UT_EXTRA_OPTS));
1235 1239
1236 printf (" %s\n", "-H, --hostname=ADDRESS"); 1240 printf (" %s\n", "-H, --hostname=ADDRESS");
1237 printf (" %s\n", _("Host name argument for servers using host headers (virtual host)")); 1241 printf (" %s\n", _("Host name argument for servers using host headers (virtual host)"));
@@ -1299,19 +1303,24 @@ print_help (void)
1299 1303
1300 printf (_(UT_VERBOSE)); 1304 printf (_(UT_VERBOSE));
1301 1305
1302 printf (_("Notes:")); 1306 printf ("\n");
1307 printf ("%s\n", _("Notes:"));
1303 printf (" %s\n", _("This plugin will attempt to open an HTTP connection with the host.")); 1308 printf (" %s\n", _("This plugin will attempt to open an HTTP connection with the host."));
1304 printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL")); 1309 printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL"));
1305 printf (" %s\n", _("other errors return STATE_UNKNOWN. Successful connects, but incorrect reponse")); 1310 printf (" %s\n", _("other errors return STATE_UNKNOWN. Successful connects, but incorrect reponse"));
1306 printf (" %s\n", _("messages from the host result in STATE_WARNING return values. If you are")); 1311 printf (" %s\n", _("messages from the host result in STATE_WARNING return values. If you are"));
1307 printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN")); 1312 printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN"));
1308 printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument.")); 1313 printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument."));
1314 printf ("\n");
1315 printf (_(UT_EXTRA_OPTS_NOTES));
1309 1316
1310#ifdef HAVE_SSL 1317#ifdef HAVE_SSL
1318 printf ("\n");
1311 printf (" %s\n", _("This plugin can also check whether an SSL enabled web server is able to")); 1319 printf (" %s\n", _("This plugin can also check whether an SSL enabled web server is able to"));
1312 printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 ")); 1320 printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 "));
1313 printf (" %s\n", _("certificate is still valid for the specified number of days.")); 1321 printf (" %s\n", _("certificate is still valid for the specified number of days."));
1314 printf (_("Examples:")); 1322 printf ("\n");
1323 printf ("%s\n", _("Examples:"));
1315 printf (" %s\n\n", "CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com"); 1324 printf (" %s\n\n", "CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com");
1316 printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,")); 1325 printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,"));
1317 printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds")); 1326 printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds"));
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index 937f84c..02f07c0 100644
--- a/plugins/check_ide_smart.c
+++ b/plugins/check_ide_smart.c
@@ -162,6 +162,9 @@ main (int argc, char *argv[])
162 values_t values; 162 values_t values;
163 int fd; 163 int fd;
164 164
165 /* Parse extra opts if any */
166 argv=np_extra_opts (&argc, argv, progname);
167
165 static struct option longopts[] = { 168 static struct option longopts[] = {
166 {"device", required_argument, 0, 'd'}, 169 {"device", required_argument, 0, 'd'},
167 {"immediate", no_argument, 0, 'i'}, 170 {"immediate", no_argument, 0, 'i'},
@@ -490,6 +493,7 @@ print_help (void)
490 print_usage (); 493 print_usage ();
491 494
492 printf (_(UT_HELP_VRSN)); 495 printf (_(UT_HELP_VRSN));
496 printf (_(UT_EXTRA_OPTS));
493 497
494 printf (" %s\n", "-d, --device=DEVICE"); 498 printf (" %s\n", "-d, --device=DEVICE");
495 printf (" %s\n", _("Select device DEVICE")); 499 printf (" %s\n", _("Select device DEVICE"));
@@ -504,6 +508,13 @@ print_help (void)
504 printf (" %s\n", _("Turn off automatic offline tests")); 508 printf (" %s\n", _("Turn off automatic offline tests"));
505 printf (" %s\n", "-n, --nagios"); 509 printf (" %s\n", "-n, --nagios");
506 printf (" %s\n", _("Output suitable for Nagios")); 510 printf (" %s\n", _("Output suitable for Nagios"));
511
512#ifdef NP_EXTRA_OPTS
513 printf ("\n");
514 printf ("%s\n", _("Notes:"));
515 printf (_(UT_EXTRA_OPTS_NOTES));
516#endif
517
507 printf (_(UT_SUPPORT)); 518 printf (_(UT_SUPPORT));
508} 519}
509 520
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 74ca3b0..3d6f05c 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -104,7 +104,10 @@ main (int argc, char *argv[])
104 if (strstr(argv[0],"check_ldaps")) { 104 if (strstr(argv[0],"check_ldaps")) {
105 asprintf (&progname, "check_ldaps"); 105 asprintf (&progname, "check_ldaps");
106 } 106 }
107 107
108 /* Parse extra opts if any */
109 argv=np_extra_opts (&argc, argv, progname);
110
108 if (process_arguments (argc, argv) == ERROR) 111 if (process_arguments (argc, argv) == ERROR)
109 usage4 (_("Could not parse arguments")); 112 usage4 (_("Could not parse arguments"));
110 113
@@ -392,11 +395,12 @@ print_help (void)
392 printf ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n"); 395 printf ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n");
393 printf (COPYRIGHT, copyright, email); 396 printf (COPYRIGHT, copyright, email);
394 397
395 printf ("\n\n"); 398 printf ("\n\n");
396 399
397 print_usage (); 400 print_usage ();
398 401
399 printf (_(UT_HELP_VRSN)); 402 printf (_(UT_HELP_VRSN));
403 printf (_(UT_EXTRA_OPTS));
400 404
401 printf (_(UT_HOST_PORT), 'p', myport); 405 printf (_(UT_HOST_PORT), 'p', myport);
402 406
@@ -429,12 +433,17 @@ print_help (void)
429 433
430 printf (_(UT_VERBOSE)); 434 printf (_(UT_VERBOSE));
431 435
432 printf ("\n%s\n", _("Notes:")); 436 printf ("\n");
437 printf ("%s\n", _("Notes:"));
433 printf (" %s\n", _("If this plugin is called via 'check_ldaps', method 'STARTTLS' will be")); 438 printf (" %s\n", _("If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"));
434 printf (_(" implied (using default port %i) unless --port=636 is specified. In that case %s"), DEFAULT_PORT, "\n"); 439 printf (_(" implied (using default port %i) unless --port=636 is specified. In that case\n"), DEFAULT_PORT);
435 printf (" %s\n", _("'SSL on connect' will be used no matter how the plugin was called.")); 440 printf (" %s\n", _("'SSL on connect' will be used no matter how the plugin was called."));
436 printf (" %s\n", _("This detection is deprecated, please use 'check_ldap' with the '--starttls' or '--ssl' flags")); 441 printf (" %s\n", _("This detection is deprecated, please use 'check_ldap' with the '--starttls' or '--ssl' flags"));
437 printf (" %s\n", _("to define the behaviour explicitly instead.")); 442 printf (" %s\n", _("to define the behaviour explicitly instead."));
443#ifdef NP_EXTRA_OPTS
444 printf ("\n");
445 printf (_(UT_EXTRA_OPTS_NOTES));
446#endif
438 447
439 printf (_(UT_SUPPORT)); 448 printf (_(UT_SUPPORT));
440} 449}
diff --git a/plugins/check_load.c b/plugins/check_load.c
index f4faa31..5ff9a8c 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -119,6 +119,9 @@ main (int argc, char **argv)
119 textdomain (PACKAGE); 119 textdomain (PACKAGE);
120 setlocale(LC_NUMERIC, "POSIX"); 120 setlocale(LC_NUMERIC, "POSIX");
121 121
122 /* Parse extra opts if any */
123 argv = np_extra_opts (&argc, argv, progname);
124
122 if (process_arguments (argc, argv) == ERROR) 125 if (process_arguments (argc, argv) == ERROR)
123 usage4 (_("Could not parse arguments")); 126 usage4 (_("Could not parse arguments"));
124 127
@@ -307,6 +310,7 @@ print_help (void)
307 print_usage (); 310 print_usage ();
308 311
309 printf (_(UT_HELP_VRSN)); 312 printf (_(UT_HELP_VRSN));
313 printf (_(UT_EXTRA_OPTS));
310 314
311 printf (" %s\n", "-w, --warning=WLOAD1,WLOAD5,WLOAD15"); 315 printf (" %s\n", "-w, --warning=WLOAD1,WLOAD5,WLOAD15");
312 printf (" %s\n", _("Exit with WARNING status if load average exceeds WLOADn")); 316 printf (" %s\n", _("Exit with WARNING status if load average exceeds WLOADn"));
@@ -316,6 +320,12 @@ print_help (void)
316 printf (" %s\n", "-r, --percpu"); 320 printf (" %s\n", "-r, --percpu");
317 printf (" %s\n", _("Divide the load averages by the number of CPUs (when possible)")); 321 printf (" %s\n", _("Divide the load averages by the number of CPUs (when possible)"));
318 322
323#ifdef NP_EXTRA_OPTS
324 printf ("\n");
325 printf ("%s\n", _("Notes:"));
326 printf (_(UT_EXTRA_OPTS_NOTES));
327#endif
328
319 printf (_(UT_SUPPORT)); 329 printf (_(UT_SUPPORT));
320} 330}
321 331
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index cf77f8b..80e5215 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -72,6 +72,9 @@ main (int argc, char **argv)
72 bindtextdomain (PACKAGE, LOCALEDIR); 72 bindtextdomain (PACKAGE, LOCALEDIR);
73 textdomain (PACKAGE); 73 textdomain (PACKAGE);
74 74
75 /* Parse extra opts if any */
76 argv=np_extra_opts (&argc, argv, progname);
77
75 if (process_arguments (argc, argv) == ERROR) 78 if (process_arguments (argc, argv) == ERROR)
76 usage4 (_("Could not parse arguments\n")); 79 usage4 (_("Could not parse arguments\n"));
77 80
@@ -327,6 +330,7 @@ print_help (void)
327 print_usage (); 330 print_usage ();
328 331
329 printf (_(UT_HELP_VRSN)); 332 printf (_(UT_HELP_VRSN));
333 printf (_(UT_EXTRA_OPTS));
330 334
331 printf (" %s\n", "-F, --logfile=FILE"); 335 printf (" %s\n", "-F, --logfile=FILE");
332 printf (" %s\n", _("The MRTG log file containing the data you want to monitor")); 336 printf (" %s\n", _("The MRTG log file containing the data you want to monitor"));
@@ -367,6 +371,9 @@ print_help (void)
367 printf (" %s\n", _("you can always hack the code to make this plugin work for you...")); 371 printf (" %s\n", _("you can always hack the code to make this plugin work for you..."));
368 printf (" %s\n", _("- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded from")); 372 printf (" %s\n", _("- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded from"));
369 printf (" %s\n", "http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"); 373 printf (" %s\n", "http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html");
374#ifdef NP_EXTRA_OPTS
375 printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
376#endif
370 377
371 printf (_(UT_SUPPORT)); 378 printf (_(UT_SUPPORT));
372} 379}
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 5ba5cdc..b971616 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -80,6 +80,9 @@ main (int argc, char **argv)
80 bindtextdomain (PACKAGE, LOCALEDIR); 80 bindtextdomain (PACKAGE, LOCALEDIR);
81 textdomain (PACKAGE); 81 textdomain (PACKAGE);
82 82
83 /* Parse extra opts if any */
84 argv=np_extra_opts (&argc, argv, progname);
85
83 if (process_arguments (argc, argv) == ERROR) 86 if (process_arguments (argc, argv) == ERROR)
84 usage4 (_("Could not parse arguments")); 87 usage4 (_("Could not parse arguments"));
85 88
@@ -347,6 +350,7 @@ print_help (void)
347 print_usage (); 350 print_usage ();
348 351
349 printf (_(UT_HELP_VRSN)); 352 printf (_(UT_HELP_VRSN));
353 printf (_(UT_EXTRA_OPTS));
350 354
351 printf (" %s\n", "-F, --filename=STRING"); 355 printf (" %s\n", "-F, --filename=STRING");
352 printf (" %s\n", _("File to read log from")); 356 printf (" %s\n", _("File to read log from"));
@@ -368,6 +372,9 @@ print_help (void)
368 printf (" %s\n", _("- The calculated i/o rates are a little off from what MRTG actually")); 372 printf (" %s\n", _("- The calculated i/o rates are a little off from what MRTG actually"));
369 printf (" %s\n", _(" reports. I'm not sure why this is right now, but will look into it")); 373 printf (" %s\n", _(" reports. I'm not sure why this is right now, but will look into it"));
370 printf (" %s\n", _(" for future enhancements of this plugin.")); 374 printf (" %s\n", _(" for future enhancements of this plugin."));
375#ifdef NP_EXTRA_OPTS
376 printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
377#endif
371 378
372 printf (_(UT_SUPPORT)); 379 printf (_(UT_SUPPORT));
373} 380}
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 3d7426d..a9f0f60 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -82,6 +82,9 @@ main (int argc, char **argv)
82 bindtextdomain (PACKAGE, LOCALEDIR); 82 bindtextdomain (PACKAGE, LOCALEDIR);
83 textdomain (PACKAGE); 83 textdomain (PACKAGE);
84 84
85 /* Parse extra opts if any */
86 argv=np_extra_opts (&argc, argv, progname);
87
85 if (process_arguments (argc, argv) == ERROR) 88 if (process_arguments (argc, argv) == ERROR)
86 usage4 (_("Could not parse arguments")); 89 usage4 (_("Could not parse arguments"));
87 90
@@ -385,6 +388,7 @@ print_help (void)
385 print_usage (); 388 print_usage ();
386 389
387 printf (_(UT_HELP_VRSN)); 390 printf (_(UT_HELP_VRSN));
391 printf (_(UT_EXTRA_OPTS));
388 392
389 printf (_(UT_HOST_PORT), 'P', myport); 393 printf (_(UT_HOST_PORT), 'P', myport);
390 printf (" %s\n", "-s, --socket=STRING"); 394 printf (" %s\n", "-s, --socket=STRING");
@@ -412,6 +416,12 @@ print_help (void)
412 printf (" %s\n", _("using the default unix socket. You can force TCP on localhost by using an")); 416 printf (" %s\n", _("using the default unix socket. You can force TCP on localhost by using an"));
413 printf (" %s\n", _("IP address or FQDN ('localhost' will use the socket as well).")); 417 printf (" %s\n", _("IP address or FQDN ('localhost' will use the socket as well)."));
414 418
419#ifdef NP_EXTRA_OPTS
420 printf ("\n");
421 printf ("%s\n", _("Notes:"));
422 printf (_(UT_EXTRA_OPTS_NOTES));
423#endif
424
415 printf (_(UT_SUPPORT)); 425 printf (_(UT_SUPPORT));
416} 426}
417 427
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
index 171fc69..6c5e436 100644
--- a/plugins/check_mysql_query.c
+++ b/plugins/check_mysql_query.c
@@ -78,6 +78,9 @@ main (int argc, char **argv)
78 bindtextdomain (PACKAGE, LOCALEDIR); 78 bindtextdomain (PACKAGE, LOCALEDIR);
79 textdomain (PACKAGE); 79 textdomain (PACKAGE);
80 80
81 /* Parse extra opts if any */
82 argv=np_extra_opts (&argc, argv, progname);
83
81 if (process_arguments (argc, argv) == ERROR) 84 if (process_arguments (argc, argv) == ERROR)
82 usage4 (_("Could not parse arguments")); 85 usage4 (_("Could not parse arguments"));
83 86
@@ -294,6 +297,7 @@ print_help (void)
294 print_usage (); 297 print_usage ();
295 298
296 printf (_(UT_HELP_VRSN)); 299 printf (_(UT_HELP_VRSN));
300 printf (_(UT_EXTRA_OPTS));
297 printf (" -q, --query=STRING\n"); 301 printf (" -q, --query=STRING\n");
298 printf (" %s\n", _("SQL query to run. Only first column in first row will be read")); 302 printf (" %s\n", _("SQL query to run. Only first column in first row will be read"));
299 printf (_(UT_WARN_CRIT_RANGE)); 303 printf (_(UT_WARN_CRIT_RANGE));
@@ -313,6 +317,12 @@ print_help (void)
313 printf (" %s\n", _("A query is required. The result from the query should be numeric.")); 317 printf (" %s\n", _("A query is required. The result from the query should be numeric."));
314 printf (" %s\n", _("For extra security, create a user with minimal access.")); 318 printf (" %s\n", _("For extra security, create a user with minimal access."));
315 319
320#ifdef NP_EXTRA_OPTS
321 printf ("\n");
322 printf ("%s\n", _("Notes:"));
323 printf (_(UT_EXTRA_OPTS_NOTES));
324#endif
325
316 printf (_(UT_SUPPORT)); 326 printf (_(UT_SUPPORT));
317} 327}
318 328
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 1f8df33..dfe6080 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -88,6 +88,9 @@ main (int argc, char **argv)
88 bindtextdomain (PACKAGE, LOCALEDIR); 88 bindtextdomain (PACKAGE, LOCALEDIR);
89 textdomain (PACKAGE); 89 textdomain (PACKAGE);
90 90
91 /* Parse extra opts if any */
92 argv=np_extra_opts (&argc, argv, progname);
93
91 if (process_arguments (argc, argv) == ERROR) 94 if (process_arguments (argc, argv) == ERROR)
92 usage_va(_("Could not parse arguments")); 95 usage_va(_("Could not parse arguments"));
93 96
@@ -289,6 +292,7 @@ print_help (void)
289 print_usage (); 292 print_usage ();
290 293
291 printf (_(UT_HELP_VRSN)); 294 printf (_(UT_HELP_VRSN));
295 printf (_(UT_EXTRA_OPTS));
292 296
293 printf (" %s\n", "-F, --filename=FILE"); 297 printf (" %s\n", "-F, --filename=FILE");
294 printf (" %s\n", _("Name of the log file to check")); 298 printf (" %s\n", _("Name of the log file to check"));
@@ -297,6 +301,13 @@ print_help (void)
297 printf (" %s\n", "-C, --command=STRING"); 301 printf (" %s\n", "-C, --command=STRING");
298 printf (" %s\n", _("Substring to search for in process arguments")); 302 printf (" %s\n", _("Substring to search for in process arguments"));
299 printf (_(UT_VERBOSE)); 303 printf (_(UT_VERBOSE));
304
305#ifdef NP_EXTRA_OPTS
306 printf ("\n");
307 printf ("%s\n", _("Notes:"));
308 printf (_(UT_EXTRA_OPTS_NOTES));
309#endif
310
300 printf ("\n"); 311 printf ("\n");
301 printf ("%s\n", _("Examples:")); 312 printf ("%s\n", _("Examples:"));
302 printf (" %s\n", "check_nagios -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios"); 313 printf (" %s\n", "check_nagios -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios");
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 681b842..ef1b530 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -122,6 +122,9 @@ int main(int argc, char **argv){
122 bindtextdomain (PACKAGE, LOCALEDIR); 122 bindtextdomain (PACKAGE, LOCALEDIR);
123 textdomain (PACKAGE); 123 textdomain (PACKAGE);
124 124
125 /* Parse extra opts if any */
126 argv=np_extra_opts (&argc, argv, progname);
127
125 if(process_arguments(argc,argv) == ERROR) 128 if(process_arguments(argc,argv) == ERROR)
126 usage4 (_("Could not parse arguments")); 129 usage4 (_("Could not parse arguments"));
127 130
@@ -644,8 +647,9 @@ void print_help(void)
644 print_usage(); 647 print_usage();
645 648
646 printf (_(UT_HELP_VRSN)); 649 printf (_(UT_HELP_VRSN));
650 printf (_(UT_EXTRA_OPTS));
647 651
648 printf ("%s\n", _("Options:")); 652 printf ("%s\n", _("Options:"));
649 printf (" %s\n", "-H, --hostname=HOST"); 653 printf (" %s\n", "-H, --hostname=HOST");
650 printf (" %s\n", _("Name of the host to check")); 654 printf (" %s\n", _("Name of the host to check"));
651 printf (" %s\n", "-p, --port=INTEGER"); 655 printf (" %s\n", "-p, --port=INTEGER");
@@ -729,6 +733,9 @@ void print_help(void)
729 printf (" %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\".")); 733 printf (" %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\"."));
730 printf (" %s\n", _("One fix for this is to change the port to something else on check_nt ")); 734 printf (" %s\n", _("One fix for this is to change the port to something else on check_nt "));
731 printf (" %s\n", _("and on the client service it\'s connecting to.")); 735 printf (" %s\n", _("and on the client service it\'s connecting to."));
736#ifdef NP_EXTRA_OPTS
737 printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
738#endif
732 739
733 printf (_(UT_SUPPORT)); 740 printf (_(UT_SUPPORT));
734} 741}
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 69c25f0..68c82d1 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -763,6 +763,9 @@ int main(int argc, char *argv[]){
763 763
764 result = offset_result = jitter_result = STATE_OK; 764 result = offset_result = jitter_result = STATE_OK;
765 765
766 /* Parse extra opts if any */
767 argv=np_extra_opts (&argc, argv, progname);
768
766 if (process_arguments (argc, argv) == ERROR) 769 if (process_arguments (argc, argv) == ERROR)
767 usage4 (_("Could not parse arguments")); 770 usage4 (_("Could not parse arguments"));
768 771
@@ -844,6 +847,7 @@ void print_help(void){
844 847
845 print_usage(); 848 print_usage();
846 printf (_(UT_HELP_VRSN)); 849 printf (_(UT_HELP_VRSN));
850 printf (_(UT_EXTRA_OPTS));
847 printf (_(UT_HOST_PORT), 'p', "123"); 851 printf (_(UT_HOST_PORT), 'p', "123");
848 printf (" %s\n", "-w, --warning=THRESHOLD"); 852 printf (" %s\n", "-w, --warning=THRESHOLD");
849 printf (" %s\n", _("Offset to result in warning status (seconds)")); 853 printf (" %s\n", _("Offset to result in warning status (seconds)"));
@@ -859,11 +863,16 @@ void print_help(void){
859 printf("\n"); 863 printf("\n");
860 printf("%s\n", _("Notes:")); 864 printf("%s\n", _("Notes:"));
861 printf(_(UT_THRESHOLDS_NOTES)); 865 printf(_(UT_THRESHOLDS_NOTES));
866#ifdef NP_EXTRA_OPTS
867 printf("\n");
868 printf(_(UT_EXTRA_OPTS_NOTES));
869#endif
862 870
863 printf("\n"); 871 printf("\n");
864 printf("%s\n", _("Examples:")); 872 printf("%s\n", _("Examples:"));
865 printf(" %s\n", _("Normal offset check:")); 873 printf(" %s\n", _("Normal offset check:"));
866 printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1")); 874 printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1"));
875 printf("\n");
867 printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available")); 876 printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available"));
868 printf(" %s\n", _("(See Notes above for more details on thresholds formats):")); 877 printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
869 printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200")); 878 printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c
index 5ed97db..67ee0a7 100644
--- a/plugins/check_ntp_peer.c
+++ b/plugins/check_ntp_peer.c
@@ -552,6 +552,9 @@ int main(int argc, char *argv[]){
552 bindtextdomain (PACKAGE, LOCALEDIR); 552 bindtextdomain (PACKAGE, LOCALEDIR);
553 textdomain (PACKAGE); 553 textdomain (PACKAGE);
554 554
555 /* Parse extra opts if any */
556 argv=np_extra_opts (&argc, argv, progname);
557
555 if (process_arguments (argc, argv) == ERROR) 558 if (process_arguments (argc, argv) == ERROR)
556 usage4 (_("Could not parse arguments")); 559 usage4 (_("Could not parse arguments"));
557 560
@@ -638,6 +641,7 @@ void print_help(void){
638 641
639 print_usage(); 642 print_usage();
640 printf (_(UT_HELP_VRSN)); 643 printf (_(UT_HELP_VRSN));
644 printf (_(UT_EXTRA_OPTS));
641 printf (_(UT_HOST_PORT), 'p', "123"); 645 printf (_(UT_HOST_PORT), 'p', "123");
642 printf (" %s\n", "-q, --quiet"); 646 printf (" %s\n", "-q, --quiet");
643 printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized")); 647 printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"));
@@ -664,17 +668,23 @@ void print_help(void){
664 printf(" %s\n", _("Use this plugin to check the health of an NTP server. It supports")); 668 printf(" %s\n", _("Use this plugin to check the health of an NTP server. It supports"));
665 printf(" %s\n", _("checking the offset with the sync peer, the jitter and stratum. This")); 669 printf(" %s\n", _("checking the offset with the sync peer, the jitter and stratum. This"));
666 printf(" %s\n", _("plugin will not check the clock offset between the local host and NTP")); 670 printf(" %s\n", _("plugin will not check the clock offset between the local host and NTP"));
667 printf(" %s\n\n", _("server; please use check_ntp_time for that purpose.")); 671 printf(" %s\n", _("server; please use check_ntp_time for that purpose."));
668 672 printf("\n");
669 printf(_(UT_THRESHOLDS_NOTES)); 673 printf(_(UT_THRESHOLDS_NOTES));
674#ifdef NP_EXTRA_OPTS
675 printf("\n");
676 printf(_(UT_EXTRA_OPTS_NOTES));
677#endif
670 678
671 printf("\n"); 679 printf("\n");
672 printf("%s\n", _("Examples:")); 680 printf("%s\n", _("Examples:"));
673 printf(" %s\n", _("Simple NTP server check:")); 681 printf(" %s\n", _("Simple NTP server check:"));
674 printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1")); 682 printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1"));
683 printf("\n");
675 printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available")); 684 printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available"));
676 printf(" %s\n", _("(See Notes above for more details on thresholds formats):")); 685 printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
677 printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200")); 686 printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
687 printf("\n");
678 printf(" %s\n", _("Check only stratum:")); 688 printf(" %s\n", _("Check only stratum:"));
679 printf(" %s\n", ("./check_ntp_peer -H ntpserv -W 4 -C 6")); 689 printf(" %s\n", ("./check_ntp_peer -H ntpserv -W 4 -C 6"));
680 690
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index ec41429..ea24a0e 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -540,6 +540,9 @@ int main(int argc, char *argv[]){
540 540
541 result = offset_result = STATE_OK; 541 result = offset_result = STATE_OK;
542 542
543 /* Parse extra opts if any */
544 argv=np_extra_opts (&argc, argv, progname);
545
543 if (process_arguments (argc, argv) == ERROR) 546 if (process_arguments (argc, argv) == ERROR)
544 usage4 (_("Could not parse arguments")); 547 usage4 (_("Could not parse arguments"));
545 548
@@ -597,6 +600,7 @@ void print_help(void){
597 600
598 print_usage(); 601 print_usage();
599 printf (_(UT_HELP_VRSN)); 602 printf (_(UT_HELP_VRSN));
603 printf (_(UT_EXTRA_OPTS));
600 printf (_(UT_HOST_PORT), 'p', "123"); 604 printf (_(UT_HOST_PORT), 'p', "123");
601 printf (" %s\n", "-q, --quiet"); 605 printf (" %s\n", "-q, --quiet");
602 printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found")); 606 printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found"));
@@ -610,13 +614,18 @@ void print_help(void){
610 printf("\n"); 614 printf("\n");
611 printf("%s\n", _("This plugin checks the clock offset between the local host and a")); 615 printf("%s\n", _("This plugin checks the clock offset between the local host and a"));
612 printf("%s\n", _("remote NTP server. It is independent of any commandline programs or")); 616 printf("%s\n", _("remote NTP server. It is independent of any commandline programs or"));
613 printf("%s\n\n", _("external libraries.")); 617 printf("%s\n", _("external libraries."));
614 618
619 printf("\n");
615 printf("%s\n", _("Notes:")); 620 printf("%s\n", _("Notes:"));
616 printf(" %s\n", _("If you'd rather want to monitor an NTP server, please use")); 621 printf(" %s\n", _("If you'd rather want to monitor an NTP server, please use"));
617 printf(" %s\n\n", _("check_ntp_peer.")); 622 printf(" %s\n", _("check_ntp_peer."));
618 623 printf("\n");
619 printf(_(UT_THRESHOLDS_NOTES)); 624 printf(_(UT_THRESHOLDS_NOTES));
625#ifdef NP_EXTRA_OPTS
626 printf("\n");
627 printf(_(UT_EXTRA_OPTS_NOTES));
628#endif
620 629
621 printf("\n"); 630 printf("\n");
622 printf("%s\n", _("Examples:")); 631 printf("%s\n", _("Examples:"));
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 3c8d5b9..b4fd3c7 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -170,6 +170,9 @@ main(int argc, char **argv) {
170 bindtextdomain (PACKAGE, LOCALEDIR); 170 bindtextdomain (PACKAGE, LOCALEDIR);
171 textdomain (PACKAGE); 171 textdomain (PACKAGE);
172 172
173 /* Parse extra opts if any */
174 argv=np_extra_opts(&argc, argv, progname);
175
173 if (process_arguments(argc,argv) == ERROR) 176 if (process_arguments(argc,argv) == ERROR)
174 usage4 (_("Could not parse arguments")); 177 usage4 (_("Could not parse arguments"));
175 178
@@ -1607,6 +1610,7 @@ void print_help(void)
1607 print_usage(); 1610 print_usage();
1608 1611
1609 printf (_(UT_HELP_VRSN)); 1612 printf (_(UT_HELP_VRSN));
1613 printf (_(UT_EXTRA_OPTS));
1610 1614
1611 printf (_(UT_HOST_PORT), 'p', myport); 1615 printf (_(UT_HOST_PORT), 'p', myport);
1612 1616
@@ -1674,6 +1678,9 @@ void print_help(void)
1674 printf (" %s\n", _("- Values for critical thresholds should be lower than warning thresholds")); 1678 printf (" %s\n", _("- Values for critical thresholds should be lower than warning thresholds"));
1675 printf (" %s\n", _(" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, ")); 1679 printf (" %s\n", _(" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "));
1676 printf (" %s\n", _(" TCB, LRUS and LRUM.")); 1680 printf (" %s\n", _(" TCB, LRUS and LRUM."));
1681#ifdef NP_EXTRA_OPTS
1682 printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
1683#endif
1677 1684
1678 printf (_(UT_SUPPORT)); 1685 printf (_(UT_SUPPORT));
1679} 1686}
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 6c3675b..af04d3b 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -99,6 +99,9 @@ main (int argc, char **argv)
99 bindtextdomain (PACKAGE, LOCALEDIR); 99 bindtextdomain (PACKAGE, LOCALEDIR);
100 textdomain (PACKAGE); 100 textdomain (PACKAGE);
101 101
102 /* Parse extra opts if any */
103 argv=np_extra_opts (&argc, argv, progname);
104
102 if (process_arguments (argc, argv) == ERROR) 105 if (process_arguments (argc, argv) == ERROR)
103 usage4 (_("Could not parse arguments")); 106 usage4 (_("Could not parse arguments"));
104 107
@@ -425,6 +428,7 @@ print_help (void)
425 print_usage (); 428 print_usage ();
426 429
427 printf (_(UT_HELP_VRSN)); 430 printf (_(UT_HELP_VRSN));
431 printf (_(UT_EXTRA_OPTS));
428 432
429 printf (_(UT_HOST_PORT), 'p', myport); 433 printf (_(UT_HOST_PORT), 'p', myport);
430 434
@@ -445,17 +449,22 @@ print_help (void)
445 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); 449 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
446 450
447 printf (_(UT_VERBOSE)); 451 printf (_(UT_VERBOSE));
448 printf ("\n");
449 printf ("%s\n", _("Notes:"));
450 452
451 printf (" %s\n", _("For the available options, the critical threshold value should always be")); 453 printf ("\n");
452 printf (" %s\n\n", _("higher than the warning threshold value, EXCEPT with the uptime variable")); 454 printf ("%s\n", _("This plugin requires that Eric Molitors' Over-CR collector daemon be"));
453
454 printf ("%s\n", _("This plugin requres that Eric Molitors' Over-CR collector daemon be"));
455 printf ("%s\n", _("running on the remote server.")); 455 printf ("%s\n", _("running on the remote server."));
456 printf ("%s\n", _("Over-CR can be downloaded from http://www.molitor.org/overcr")); 456 printf ("%s\n", _("Over-CR can be downloaded from http://www.molitor.org/overcr"));
457 printf ("%s\n", _("This plugin was tested with version 0.99.53 of the Over-CR collector")); 457 printf ("%s\n", _("This plugin was tested with version 0.99.53 of the Over-CR collector"));
458 458
459 printf ("\n");
460 printf ("%s\n", _("Notes:"));
461 printf (" %s\n", _("For the available options, the critical threshold value should always be"));
462 printf (" %s\n", _("higher than the warning threshold value, EXCEPT with the uptime variable"));
463#ifdef NP_EXTRA_OPTS
464 printf ("\n");
465 printf (_(UT_EXTRA_OPTS_NOTES));
466#endif
467
459 printf (_(UT_SUPPORT)); 468 printf (_(UT_SUPPORT));
460} 469}
461 470
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index c721b07..1a93f6b 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -150,6 +150,9 @@ main (int argc, char **argv)
150 bindtextdomain (PACKAGE, LOCALEDIR); 150 bindtextdomain (PACKAGE, LOCALEDIR);
151 textdomain (PACKAGE); 151 textdomain (PACKAGE);
152 152
153 /* Parse extra opts if any */
154 argv=np_extra_opts (&argc, argv, progname);
155
153 if (process_arguments (argc, argv) == ERROR) 156 if (process_arguments (argc, argv) == ERROR)
154 usage4 (_("Could not parse arguments")); 157 usage4 (_("Could not parse arguments"));
155 158
@@ -412,6 +415,7 @@ print_help (void)
412 print_usage (); 415 print_usage ();
413 416
414 printf (_(UT_HELP_VRSN)); 417 printf (_(UT_HELP_VRSN));
418 printf (_(UT_EXTRA_OPTS));
415 419
416 printf (_(UT_HOST_PORT), 'P', myport); 420 printf (_(UT_HOST_PORT), 'P', myport);
417 421
@@ -447,6 +451,12 @@ print_help (void)
447 printf (" %s\n", _("able to connect to the database without a password. The plugin can also send")); 451 printf (" %s\n", _("able to connect to the database without a password. The plugin can also send"));
448 printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password.")); 452 printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password."));
449 453
454#ifdef NP_EXTRA_OPTS
455 printf ("\n");
456 printf ("%s\n", _("Notes:"));
457 printf (_(UT_EXTRA_OPTS_NOTES));
458#endif
459
450 printf (_(UT_SUPPORT)); 460 printf (_(UT_SUPPORT));
451} 461}
452 462
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index e22856d..0f3292d 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -92,6 +92,9 @@ main (int argc, char **argv)
92 addresses = malloc (sizeof(char*) * max_addr); 92 addresses = malloc (sizeof(char*) * max_addr);
93 addresses[0] = NULL; 93 addresses[0] = NULL;
94 94
95 /* Parse extra opts if any */
96 argv=np_extra_opts (&argc, argv, progname);
97
95 if (process_arguments (argc, argv) == ERROR) 98 if (process_arguments (argc, argv) == ERROR)
96 usage4 (_("Could not parse arguments")); 99 usage4 (_("Could not parse arguments"));
97 100
@@ -564,6 +567,7 @@ print_help (void)
564 print_usage (); 567 print_usage ();
565 568
566 printf (_(UT_HELP_VRSN)); 569 printf (_(UT_HELP_VRSN));
570 printf (_(UT_EXTRA_OPTS));
567 571
568 printf (_(UT_IPv46)); 572 printf (_(UT_IPv46));
569 573
@@ -592,6 +596,12 @@ print_help (void)
592 printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in")); 596 printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"));
593 printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/")); 597 printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/"));
594 598
599#ifdef NP_EXTRA_OPTS
600 printf ("\n");
601 printf ("%s\n", _("Notes:"));
602 printf (_(UT_EXTRA_OPTS_NOTES));
603#endif
604
595 printf (_(UT_SUPPORT)); 605 printf (_(UT_SUPPORT));
596} 606}
597 607
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 816da1b..875f867 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -143,6 +143,9 @@ main (int argc, char **argv)
143 asprintf (&metric_name, "PROCS"); 143 asprintf (&metric_name, "PROCS");
144 metric = METRIC_PROCS; 144 metric = METRIC_PROCS;
145 145
146 /* Parse extra opts if any */
147 argv=np_extra_opts (&argc, argv, progname);
148
146 if (process_arguments (argc, argv) == ERROR) 149 if (process_arguments (argc, argv) == ERROR)
147 usage4 (_("Could not parse arguments")); 150 usage4 (_("Could not parse arguments"));
148 151
@@ -715,13 +718,12 @@ print_help (void)
715 718
716 print_usage (); 719 print_usage ();
717 720
718 printf ("%s\n", _("Required Arguments:")); 721 printf (_(UT_HELP_VRSN));
722 printf (_(UT_EXTRA_OPTS));
719 printf (" %s\n", "-w, --warning=RANGE"); 723 printf (" %s\n", "-w, --warning=RANGE");
720 printf (" %s\n", _("Generate warning state if metric is outside this range")); 724 printf (" %s\n", _("Generate warning state if metric is outside this range"));
721 printf (" %s\n", "-c, --critical=RANGE"); 725 printf (" %s\n", "-c, --critical=RANGE");
722 printf (" %s\n", _("Generate critical state if metric is outside this range")); 726 printf (" %s\n", _("Generate critical state if metric is outside this range"));
723
724 printf ("%s\n", _("Optional Arguments:"));
725 printf (" %s\n", "-m, --metric=TYPE"); 727 printf (" %s\n", "-m, --metric=TYPE");
726 printf (" %s\n", _("Check thresholds against metric. Valid types:")); 728 printf (" %s\n", _("Check thresholds against metric. Valid types:"));
727 printf (" %s\n", _("PROCS - number of processes (default)")); 729 printf (" %s\n", _("PROCS - number of processes (default)"));
@@ -737,7 +739,8 @@ print_help (void)
737 printf (" %s\n", "-v, --verbose"); 739 printf (" %s\n", "-v, --verbose");
738 printf (" %s\n", _("Extra information. Up to 3 verbosity levels")); 740 printf (" %s\n", _("Extra information. Up to 3 verbosity levels"));
739 741
740 printf ("%s\n", "Optional Filters:"); 742 printf ("\n");
743 printf ("%s\n", "Filters:");
741 printf (" %s\n", "-s, --state=STATUSFLAGS"); 744 printf (" %s\n", "-s, --state=STATUSFLAGS");
742 printf (" %s\n", _("Only scan for processes that have, in the output of `ps`, one or")); 745 printf (" %s\n", _("Only scan for processes that have, in the output of `ps`, one or"));
743 printf (" %s\n", _("more of the status flags you specify (for example R, Z, S, RS,")); 746 printf (" %s\n", _("more of the status flags you specify (for example R, Z, S, RS,"));
@@ -771,6 +774,12 @@ the specified threshold ranges. The process count can be filtered by\n\
771process owner, parent process PID, current state (e.g., 'Z'), or may\n\ 774process owner, parent process PID, current state (e.g., 'Z'), or may\n\
772be the total number of running processes\n\n")); 775be the total number of running processes\n\n"));
773 776
777#ifdef NP_EXTRA_OPTS
778 printf ("%s\n", _("Notes:"));
779 printf (_(UT_EXTRA_OPTS_NOTES));
780 printf ("\n");
781#endif
782
774 printf ("%s\n", _("Examples:")); 783 printf ("%s\n", _("Examples:"));
775 printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry"); 784 printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry");
776 printf (" %s\n", _("Warning if not two processes with command name portsentry.")); 785 printf (" %s\n", _("Warning if not two processes with command name portsentry."));
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 2afe3c8..7ce820a 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -149,6 +149,9 @@ main (int argc, char **argv)
149 bindtextdomain (PACKAGE, LOCALEDIR); 149 bindtextdomain (PACKAGE, LOCALEDIR);
150 textdomain (PACKAGE); 150 textdomain (PACKAGE);
151 151
152 /* Parse extra opts if any */
153 argv=np_extra_opts (&argc, argv, progname);
154
152 if (process_arguments (argc, argv) == ERROR) 155 if (process_arguments (argc, argv) == ERROR)
153 usage4 (_("Could not parse arguments")); 156 usage4 (_("Could not parse arguments"));
154 157
@@ -315,6 +318,7 @@ print_help (void)
315 print_usage (); 318 print_usage ();
316 319
317 printf (_(UT_HELP_VRSN)); 320 printf (_(UT_HELP_VRSN));
321 printf (_(UT_EXTRA_OPTS));
318 322
319 printf (_(UT_HOST_PORT), 'P', myport); 323 printf (_(UT_HOST_PORT), 'P', myport);
320 324
@@ -344,6 +348,12 @@ print_help (void)
344 printf ("%s\n", _("run the plugin at regular predictable intervals. Please be sure that")); 348 printf ("%s\n", _("run the plugin at regular predictable intervals. Please be sure that"));
345 printf ("%s\n", _("the password used does not allow access to sensitive system resources.")); 349 printf ("%s\n", _("the password used does not allow access to sensitive system resources."));
346 350
351#ifdef NP_EXTRA_OPTS
352 printf ("\n");
353 printf ("%s\n", _("Notes:"));
354 printf (_(UT_EXTRA_OPTS_NOTES));
355#endif
356
347 printf (_(UT_SUPPORT)); 357 printf (_(UT_SUPPORT));
348} 358}
349 359
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 68a6c1e..d333c2a 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -77,6 +77,9 @@ main (int argc, char **argv)
77 bindtextdomain (PACKAGE, LOCALEDIR); 77 bindtextdomain (PACKAGE, LOCALEDIR);
78 textdomain (PACKAGE); 78 textdomain (PACKAGE);
79 79
80 /* Parse extra opts if any */
81 argv=np_extra_opts (&argc, argv, progname);
82
80 if (process_arguments (argc, argv) == ERROR) 83 if (process_arguments (argc, argv) == ERROR)
81 usage4 (_("Could not parse arguments")); 84 usage4 (_("Could not parse arguments"));
82 85
@@ -418,6 +421,7 @@ print_help (void)
418 print_usage (); 421 print_usage ();
419 422
420 printf (_(UT_HELP_VRSN)); 423 printf (_(UT_HELP_VRSN));
424 printf (_(UT_EXTRA_OPTS));
421 425
422 printf (_(UT_HOST_PORT), 'p', myport); 426 printf (_(UT_HOST_PORT), 'p', myport);
423 427
@@ -440,6 +444,12 @@ print_help (void)
440 printf ("%s\n", _("but incorrect reponse messages from the host result in STATE_WARNING return")); 444 printf ("%s\n", _("but incorrect reponse messages from the host result in STATE_WARNING return"));
441 printf ("%s\n", _("values.")); 445 printf ("%s\n", _("values."));
442 446
447#ifdef NP_EXTRA_OPTS
448 printf ("\n");
449 printf ("%s\n", _("Notes:"));
450 printf (_(UT_EXTRA_OPTS_NOTES));
451#endif
452
443 printf (_(UT_SUPPORT)); 453 printf (_(UT_SUPPORT));
444} 454}
445 455
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index b1fc7ee..8ff10b8 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -137,6 +137,9 @@ main (int argc, char **argv)
137 bindtextdomain (PACKAGE, LOCALEDIR); 137 bindtextdomain (PACKAGE, LOCALEDIR);
138 textdomain (PACKAGE); 138 textdomain (PACKAGE);
139 139
140 /* Parse extra opts if any */
141 argv=np_extra_opts (&argc, argv, progname);
142
140 if (process_arguments (argc, argv) == ERROR) 143 if (process_arguments (argc, argv) == ERROR)
141 usage4 (_("Could not parse arguments")); 144 usage4 (_("Could not parse arguments"));
142 145
@@ -771,6 +774,7 @@ print_help (void)
771 print_usage (); 774 print_usage ();
772 775
773 printf (_(UT_HELP_VRSN)); 776 printf (_(UT_HELP_VRSN));
777 printf (_(UT_EXTRA_OPTS));
774 778
775 printf (_(UT_HOST_PORT), 'p', myport); 779 printf (_(UT_HOST_PORT), 'p', myport);
776 780
@@ -812,6 +816,12 @@ print_help (void)
812 printf ("%s\n", _("connects, but incorrect reponse messages from the host result in")); 816 printf ("%s\n", _("connects, but incorrect reponse messages from the host result in"));
813 printf ("%s\n", _("STATE_WARNING return values.")); 817 printf ("%s\n", _("STATE_WARNING return values."));
814 818
819#ifdef NP_EXTRA_OPTS
820 printf ("\n");
821 printf ("%s\n", _("Notes:"));
822 printf (_(UT_EXTRA_OPTS_NOTES));
823#endif
824
815 printf (_(UT_SUPPORT)); 825 printf (_(UT_SUPPORT));
816} 826}
817 827
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index b943565..0acade2 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -176,6 +176,9 @@ main (int argc, char **argv)
176 timeout_interval = DEFAULT_TIMEOUT; 176 timeout_interval = DEFAULT_TIMEOUT;
177 retries = DEFAULT_RETRIES; 177 retries = DEFAULT_RETRIES;
178 178
179 /* Parse extra opts if any */
180 argv=np_extra_opts (&argc, argv, progname);
181
179 if (process_arguments (argc, argv) == ERROR) 182 if (process_arguments (argc, argv) == ERROR)
180 usage4 (_("Could not parse arguments")); 183 usage4 (_("Could not parse arguments"));
181 184
@@ -932,6 +935,7 @@ print_help (void)
932 print_usage (); 935 print_usage ();
933 936
934 printf (_(UT_HELP_VRSN)); 937 printf (_(UT_HELP_VRSN));
938 printf (_(UT_EXTRA_OPTS));
935 939
936 printf (_(UT_HOST_PORT), 'p', DEFAULT_PORT); 940 printf (_(UT_HOST_PORT), 'p', DEFAULT_PORT);
937 941
@@ -1017,6 +1021,9 @@ print_help (void)
1017 printf (" %s\n", _("- Note that only one string and one regex may be checked at present")); 1021 printf (" %s\n", _("- Note that only one string and one regex may be checked at present"));
1018 printf (" %s\n", _("- All evaluation methods other than PR, STR, and SUBSTR expect that the value")); 1022 printf (" %s\n", _("- All evaluation methods other than PR, STR, and SUBSTR expect that the value"));
1019 printf (" %s\n", _("returned from the SNMP query is an unsigned integer.")); 1023 printf (" %s\n", _("returned from the SNMP query is an unsigned integer."));
1024#ifdef NP_EXTRA_OPTS
1025 printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
1026#endif
1020 1027
1021 printf (_(UT_SUPPORT)); 1028 printf (_(UT_SUPPORT));
1022} 1029}
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index 869b803..4b5f6b7 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -70,6 +70,9 @@ main (int argc, char **argv)
70 bindtextdomain (PACKAGE, LOCALEDIR); 70 bindtextdomain (PACKAGE, LOCALEDIR);
71 textdomain (PACKAGE); 71 textdomain (PACKAGE);
72 72
73 /* Parse extra opts if any */
74 argv=np_extra_opts (&argc, argv, progname);
75
73 if (process_arguments (argc, argv) == ERROR) 76 if (process_arguments (argc, argv) == ERROR)
74 usage4 (_("Could not parse arguments")); 77 usage4 (_("Could not parse arguments"));
75 78
@@ -281,6 +284,7 @@ print_help (void)
281 print_usage (); 284 print_usage ();
282 285
283 printf (_(UT_HELP_VRSN)); 286 printf (_(UT_HELP_VRSN));
287 printf (_(UT_EXTRA_OPTS));
284 288
285 printf (_(UT_HOST_PORT), 'p', myport); 289 printf (_(UT_HOST_PORT), 'p', myport);
286 290
@@ -293,6 +297,12 @@ print_help (void)
293 297
294 printf (_(UT_VERBOSE)); 298 printf (_(UT_VERBOSE));
295 299
300#ifdef NP_EXTRA_OPTS
301 printf ("\n");
302 printf ("%s\n", _("Notes:"));
303 printf (_(UT_EXTRA_OPTS_NOTES));
304#endif
305
296 printf (_(UT_SUPPORT)); 306 printf (_(UT_SUPPORT));
297} 307}
298 308
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 1c627ac..04cc1ae 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -107,6 +107,9 @@ main (int argc, char **argv)
107 107
108 status = strdup (""); 108 status = strdup ("");
109 109
110 /* Parse extra opts if any */
111 argv=np_extra_opts (&argc, argv, progname);
112
110 if (process_arguments (argc, argv) == ERROR) 113 if (process_arguments (argc, argv) == ERROR)
111 usage4 (_("Could not parse arguments")); 114 usage4 (_("Could not parse arguments"));
112 115
@@ -530,6 +533,7 @@ print_help (void)
530 print_usage (); 533 print_usage ();
531 534
532 printf (_(UT_HELP_VRSN)); 535 printf (_(UT_HELP_VRSN));
536 printf (_(UT_EXTRA_OPTS));
533 537
534 printf (" %s\n", "-w, --warning=INTEGER"); 538 printf (" %s\n", "-w, --warning=INTEGER");
535 printf (" %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free")); 539 printf (" %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free"));
@@ -546,6 +550,11 @@ print_help (void)
546 printf ("\n"); 550 printf ("\n");
547 printf ("%s\n", _("Notes:")); 551 printf ("%s\n", _("Notes:"));
548 printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.")); 552 printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."));
553#ifdef NP_EXTRA_OPTS
554 printf ("\n");
555 printf (_(UT_EXTRA_OPTS_NOTES));
556#endif
557
549 558
550 printf (_(UT_SUPPORT)); 559 printf (_(UT_SUPPORT));
551} 560}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index d74b5a8..3ad3131 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -205,6 +205,9 @@ main (int argc, char **argv)
205 server_quit = QUIT; 205 server_quit = QUIT;
206 status = NULL; 206 status = NULL;
207 207
208 /* Parse extra opts if any */
209 argv=np_extra_opts (&argc, argv, progname);
210
208 if (process_arguments (argc, argv) == ERROR) 211 if (process_arguments (argc, argv) == ERROR)
209 usage4 (_("Could not parse arguments")); 212 usage4 (_("Could not parse arguments"));
210 213
@@ -602,6 +605,7 @@ print_help (void)
602 print_usage (); 605 print_usage ();
603 606
604 printf (_(UT_HELP_VRSN)); 607 printf (_(UT_HELP_VRSN));
608 printf (_(UT_EXTRA_OPTS));
605 609
606 printf (_(UT_HOST_PORT), 'p', "none"); 610 printf (_(UT_HOST_PORT), 'p', "none");
607 611
@@ -642,6 +646,12 @@ print_help (void)
642 646
643 printf (_(UT_VERBOSE)); 647 printf (_(UT_VERBOSE));
644 648
649#ifdef NP_EXTRA_OPTS
650 printf ("\n");
651 printf ("%s\n", _("Notes:"));
652 printf (_(UT_EXTRA_OPTS_NOTES));
653#endif
654
645 printf (_(UT_SUPPORT)); 655 printf (_(UT_SUPPORT));
646} 656}
647 657
diff --git a/plugins/check_time.c b/plugins/check_time.c
index acfc3ef..b6d9e38 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -75,6 +75,9 @@ main (int argc, char **argv)
75 bindtextdomain (PACKAGE, LOCALEDIR); 75 bindtextdomain (PACKAGE, LOCALEDIR);
76 textdomain (PACKAGE); 76 textdomain (PACKAGE);
77 77
78 /* Parse extra opts if any */
79 argv=np_extra_opts (&argc, argv, progname);
80
78 if (process_arguments (argc, argv) == ERROR) 81 if (process_arguments (argc, argv) == ERROR)
79 usage4 (_("Could not parse arguments")); 82 usage4 (_("Could not parse arguments"));
80 83
@@ -344,6 +347,7 @@ print_help (void)
344 print_usage (); 347 print_usage ();
345 348
346 printf (_(UT_HELP_VRSN)); 349 printf (_(UT_HELP_VRSN));
350 printf (_(UT_EXTRA_OPTS));
347 351
348 printf (_(UT_HOST_PORT), 'p', myport); 352 printf (_(UT_HOST_PORT), 'p', myport);
349 353
@@ -359,6 +363,13 @@ print_help (void)
359 printf (" %s\n", _("Response time (sec.) necessary to result in critical status")); 363 printf (" %s\n", _("Response time (sec.) necessary to result in critical status"));
360 364
361 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); 365 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
366
367#ifdef NP_EXTRA_OPTS
368 printf ("\n");
369 printf ("%s\n", _("Notes:"));
370 printf (_(UT_EXTRA_OPTS_NOTES));
371#endif
372
362 printf (_(UT_SUPPORT)); 373 printf (_(UT_SUPPORT));
363} 374}
364 375
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 666485e..773da5f 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -119,6 +119,9 @@ main (int argc, char **argv)
119 data = strdup (""); 119 data = strdup ("");
120 message = strdup (""); 120 message = strdup ("");
121 121
122 /* Parse extra opts if any */
123 argv=np_extra_opts (&argc, argv, progname);
124
122 if (process_arguments (argc, argv) == ERROR) 125 if (process_arguments (argc, argv) == ERROR)
123 usage4 (_("Could not parse arguments")); 126 usage4 (_("Could not parse arguments"));
124 127
@@ -609,6 +612,7 @@ print_help (void)
609 print_usage (); 612 print_usage ();
610 613
611 printf (_(UT_HELP_VRSN)); 614 printf (_(UT_HELP_VRSN));
615 printf (_(UT_EXTRA_OPTS));
612 616
613 printf (_(UT_HOST_PORT), 'p', myport); 617 printf (_(UT_HOST_PORT), 'p', myport);
614 618
@@ -640,12 +644,15 @@ print_help (void)
640 printf (" %s\n", _("battery load, etc.) as well as warning and critical thresholds for the value")); 644 printf (" %s\n", _("battery load, etc.) as well as warning and critical thresholds for the value"));
641 printf (" %s\n", _("of that variable. If the remote host has multiple UPS that are being monitored")); 645 printf (" %s\n", _("of that variable. If the remote host has multiple UPS that are being monitored"));
642 printf (" %s\n", _("you will have to use the --ups option to specify which UPS to check.")); 646 printf (" %s\n", _("you will have to use the --ups option to specify which UPS to check."));
643
644 printf ("\n"); 647 printf ("\n");
645 printf (" %s\n", _("This plugin requires that the UPSD daemon distributed with Russel Kroll's")); 648 printf (" %s\n", _("This plugin requires that the UPSD daemon distributed with Russel Kroll's"));
646 printf (" %s\n", _("Smart UPS Tools be installed on the remote host. If you do not have the")); 649 printf (" %s\n", _("Smart UPS Tools be installed on the remote host. If you do not have the"));
647 printf (" %s\n", _("package installed on your system, you can download it from")); 650 printf (" %s\n", _("package installed on your system, you can download it from"));
648 printf (" %s\n", _("http://www.networkupstools.org")); 651 printf (" %s\n", _("http://www.networkupstools.org"));
652#ifdef NP_EXTRA_OPTS
653 printf ("\n");
654 printf (_(UT_EXTRA_OPTS_NOTES));
655#endif
649 656
650 printf (_(UT_SUPPORT)); 657 printf (_(UT_SUPPORT));
651} 658}
diff --git a/plugins/check_users.c b/plugins/check_users.c
index c81822b..e4ef681 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -65,6 +65,9 @@ main (int argc, char **argv)
65 65
66 perf = strdup(""); 66 perf = strdup("");
67 67
68 /* Parse extra opts if any */
69 argv=np_extra_opts (&argc, argv, progname);
70
68 if (process_arguments (argc, argv) == ERROR) 71 if (process_arguments (argc, argv) == ERROR)
69 usage4 (_("Could not parse arguments")); 72 usage4 (_("Could not parse arguments"));
70 73
@@ -213,12 +216,19 @@ print_help (void)
213 print_usage (); 216 print_usage ();
214 217
215 printf (_(UT_HELP_VRSN)); 218 printf (_(UT_HELP_VRSN));
219 printf (_(UT_EXTRA_OPTS));
216 220
217 printf (" %s\n", "-w, --warning=INTEGER"); 221 printf (" %s\n", "-w, --warning=INTEGER");
218 printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in")); 222 printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
219 printf (" %s\n", "-c, --critical=INTEGER"); 223 printf (" %s\n", "-c, --critical=INTEGER");
220 printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in")); 224 printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
221 225
226#ifdef NP_EXTRA_OPTS
227 printf ("\n");
228 printf ("%s\n", _("Notes:"));
229 printf (_(UT_EXTRA_OPTS_NOTES));
230#endif
231
222 printf (_(UT_SUPPORT)); 232 printf (_(UT_SUPPORT));
223} 233}
224 234
diff --git a/plugins/utils.h b/plugins/utils.h
index def8970..67e099d 100644
--- a/plugins/utils.h
+++ b/plugins/utils.h
@@ -16,6 +16,14 @@ suite of plugins. */
16/* now some functions etc are being defined in ../lib/utils_base.c */ 16/* now some functions etc are being defined in ../lib/utils_base.c */
17#include "utils_base.h" 17#include "utils_base.h"
18 18
19#ifdef NP_EXTRA_OPTS
20/* Include extra-opts functions if compiled in */
21#include "extra_opts.h"
22#else
23/* else, fake np_extra_opts */
24#define np_extra_opts(acptr,av,pr) av
25#endif
26
19/* Standardize version information, termination */ 27/* Standardize version information, termination */
20 28
21/* $Id$ */ 29/* $Id$ */
@@ -173,6 +181,17 @@ char *fperfdata (const char *,
173 -t, --timeout=INTEGER\n\ 181 -t, --timeout=INTEGER\n\
174 Seconds before connection times out (default: %d)\n" 182 Seconds before connection times out (default: %d)\n"
175 183
184#ifdef NP_EXTRA_OPTS
185#define UT_EXTRA_OPTS "\
186 --extra-opts=[section][@file]\n\
187 Read additionnal options from ini file\n"
188#define UT_EXTRA_OPTS_NOTES "\
189 See: http://nagiosplugins.org/extra-opts for --extra-opts usage and examples.\n"
190#else
191#define UT_EXTRA_OPTS ""
192#define UT_EXTRA_OPTS_NOTES ""
193#endif
194
176#define UT_THRESHOLDS_NOTES "\ 195#define UT_THRESHOLDS_NOTES "\
177 See:\n\ 196 See:\n\
178 http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT\n\ 197 http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT\n\