SF.net SVN: nagiosplug: [1991] nagiosplug/trunk/plugins

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 1991
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1991&view=rev
Author:   dermoth
Date:     2008-05-07 03:02:42 -0700 (Wed, 07 May 2008)

Log Message:
-----------
Added support for --extra-opts in all C plugins (disabled by default, see configure --help)

Modified Paths:
--------------
    nagiosplug/trunk/plugins/check_apt.c
    nagiosplug/trunk/plugins/check_by_ssh.c
    nagiosplug/trunk/plugins/check_cluster.c
    nagiosplug/trunk/plugins/check_dig.c
    nagiosplug/trunk/plugins/check_disk.c
    nagiosplug/trunk/plugins/check_dns.c
    nagiosplug/trunk/plugins/check_fping.c
    nagiosplug/trunk/plugins/check_game.c
    nagiosplug/trunk/plugins/check_hpjd.c
    nagiosplug/trunk/plugins/check_http.c
    nagiosplug/trunk/plugins/check_ide_smart.c
    nagiosplug/trunk/plugins/check_ldap.c
    nagiosplug/trunk/plugins/check_load.c
    nagiosplug/trunk/plugins/check_mrtg.c
    nagiosplug/trunk/plugins/check_mrtgtraf.c
    nagiosplug/trunk/plugins/check_mysql.c
    nagiosplug/trunk/plugins/check_mysql_query.c
    nagiosplug/trunk/plugins/check_nagios.c
    nagiosplug/trunk/plugins/check_nt.c
    nagiosplug/trunk/plugins/check_ntp.c
    nagiosplug/trunk/plugins/check_ntp_peer.c
    nagiosplug/trunk/plugins/check_ntp_time.c
    nagiosplug/trunk/plugins/check_nwstat.c
    nagiosplug/trunk/plugins/check_overcr.c
    nagiosplug/trunk/plugins/check_pgsql.c
    nagiosplug/trunk/plugins/check_ping.c
    nagiosplug/trunk/plugins/check_procs.c
    nagiosplug/trunk/plugins/check_radius.c
    nagiosplug/trunk/plugins/check_real.c
    nagiosplug/trunk/plugins/check_smtp.c
    nagiosplug/trunk/plugins/check_snmp.c
    nagiosplug/trunk/plugins/check_ssh.c
    nagiosplug/trunk/plugins/check_swap.c
    nagiosplug/trunk/plugins/check_tcp.c
    nagiosplug/trunk/plugins/check_time.c
    nagiosplug/trunk/plugins/check_ups.c
    nagiosplug/trunk/plugins/check_users.c
    nagiosplug/trunk/plugins/utils.h
    nagiosplug/trunk/plugins-root/check_dhcp.c
    nagiosplug/trunk/plugins-root/check_icmp.c

Modified: nagiosplug/trunk/plugins/check_apt.c
===================================================================
--- nagiosplug/trunk/plugins/check_apt.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_apt.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -88,6 +88,9 @@
 int main (int argc, char **argv) {
 	int result=STATE_UNKNOWN, packages_available=0, sec_count=0;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts(&argc, argv, progname);
+
 	if (process_arguments(argc, argv) == ERROR)
 		usage_va(_("Could not parse arguments"));
 
@@ -414,6 +417,7 @@
   print_usage();
 
   printf(_(UT_HELP_VRSN));
+  printf(_(UT_EXTRA_OPTS));
 
   printf(_(UT_TIMEOUT), timeout_interval);
 
@@ -454,6 +458,12 @@
   printf ("    %s\n", _("timeout (with -t) to prevent the plugin from timing out if apt-get"));
   printf ("    %s\n", _("upgrade is expected to take longer than the default timeout."));
 
+#ifdef NP_EXTRA_OPTS
+  printf("\n");
+  printf("%s\n", _("Notes:"));
+  printf(_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf(_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_by_ssh.c
===================================================================
--- nagiosplug/trunk/plugins/check_by_ssh.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_by_ssh.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -76,6 +76,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	/* process arguments */
 	if (process_arguments (argc, argv) == ERROR)
 		usage_va(_("Could not parse arguments"));
@@ -350,6 +353,8 @@
 
 	printf (_(UT_HELP_VRSN));
 
+	printf (_(UT_EXTRA_OPTS));
+
 	printf (_(UT_HOST_PORT), 'p', "none");
 
 	printf (_(UT_IPv46));
@@ -402,6 +407,12 @@
   printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days");
   printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days");
 
+#ifdef NP_EXTRA_OPTS
+	printf("\n");
+	printf("%s\n", _("Notes:"));
+	printf(_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf(_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_cluster.c
===================================================================
--- nagiosplug/trunk/plugins/check_cluster.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_cluster.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -74,6 +74,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts(&argc, argv, progname);
+
 	if(process_arguments(argc,argv)==ERROR)
 		usage(_("Could not parse arguments"));
 
@@ -236,6 +239,7 @@
 
 	printf("\n");
 	printf("%s\n", _("Options:"));
+	printf(_(UT_EXTRA_OPTS));
 	printf (" %s\n", "-s, --service");
 	printf ("    %s\n", _("Check service cluster status"));
 	printf (" %s\n", "-h, --host");
@@ -257,6 +261,10 @@
 	printf("\n");
 	printf("%s\n", _("Notes:"));
 	printf(_(UT_THRESHOLDS_NOTES));
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf(_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_dig.c
===================================================================
--- nagiosplug/trunk/plugins/check_dig.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_dig.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -84,6 +84,9 @@
   if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR)
     usage_va(_("Cannot catch SIGALRM"));
 
+  /* Parse extra opts if any */
+  argv=np_extra_opts (&argc, argv, progname);
+
   if (process_arguments (argc, argv) == ERROR)
     usage_va(_("Could not parse arguments"));
 
@@ -317,6 +320,8 @@
 
   printf (_(UT_HELP_VRSN));
 
+  printf (_(UT_EXTRA_OPTS));
+
   printf (_(UT_HOST_PORT), 'p', myport);
 
   printf (" %s\n","-l, --query_address=STRING");
@@ -332,11 +337,17 @@
   printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
   printf (_(UT_VERBOSE));
 
-  printf("\n");
+  printf ("\n");
   printf ("%s\n", _("Examples:"));
   printf (" %s\n", "check_dig -H DNSSERVER -l www.example.com -A \"+tcp\"");
   printf (" %s\n", "This will send a tcp query to DNSSERVER for www.example.com");
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_disk.c
===================================================================
--- nagiosplug/trunk/plugins/check_disk.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_disk.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -192,6 +192,9 @@
 
   mount_list = read_file_system_list (0);
 
+  /* Parse extra opts if any */
+  argv = np_extra_opts (&argc, argv, progname);
+
   if (process_arguments (argc, argv) == ERROR)
     usage4 (_("Could not parse arguments"));
 
@@ -903,6 +906,7 @@
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-w, --warning=INTEGER");
   printf ("    %s\n", _("Exit with WARNING status if less than INTEGER units of disk are free"));
@@ -955,7 +959,14 @@
   printf (_(UT_VERBOSE));
   printf (" %s\n", "-X, --exclude-type=TYPE");
   printf ("    %s\n", _("Ignore all filesystems of indicated type (may be repeated)"));
+
+#ifdef NP_EXTRA_OPTS
   printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
+  printf ("\n");
   printf ("%s\n", _("Examples:"));
   printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /");
   printf ("    %s\n", _("Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"));

Modified: nagiosplug/trunk/plugins/check_dns.c
===================================================================
--- nagiosplug/trunk/plugins/check_dns.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_dns.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -99,6 +99,9 @@
     usage_va(_("Cannot catch SIGALRM"));
   }
 
+  /* Parse extra opts if any */
+  argv=np_extra_opts (&argc, argv, progname);
+
   if (process_arguments (argc, argv) == ERROR) {
     usage_va(_("Could not parse arguments"));
   }
@@ -457,6 +460,7 @@
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" -H, --hostname=HOST\n");
   printf ("    %s\n", _("The name or address you want to query"));
@@ -475,6 +479,13 @@
   printf ("    %s\n", _("Return critical if elapsed time exceeds value. Default off"));
 
   printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
+
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_fping.c
===================================================================
--- nagiosplug/trunk/plugins/check_fping.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_fping.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -83,6 +83,9 @@
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  /* Parse extra opts if any */
+  argv=np_extra_opts (&argc, argv, progname);
+
   if (process_arguments (argc, argv) == ERROR)
     usage4 (_("Could not parse arguments"));
 
@@ -379,6 +382,7 @@
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-H, --hostname=HOST");
   printf ("    %s\n", _("name or IP Address of host to ping (IP Address bypasses name lookup, reducing system load)"));
@@ -395,6 +399,13 @@
   printf (" %s\n", _("THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time (ms)"));
   printf (" %s\n", _("which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"));
   printf (" %s\n", _("packet loss to trigger an alarm state."));
+
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_game.c
===================================================================
--- nagiosplug/trunk/plugins/check_game.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_game.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -79,6 +79,9 @@
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
+  /* Parse extra opts if any */
+  argv=np_extra_opts (&argc, argv, progname);
+
   if (process_arguments (argc, argv) == ERROR)
     usage_va(_("Could not parse arguments"));
 
@@ -302,6 +305,7 @@
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-p");
   printf ("    %s\n", _("Optional port of which to connect"));
@@ -319,6 +323,10 @@
   printf (" %s\n", _("This plugin uses the 'qstat' command, the popular game server status query tool."));
   printf (" %s\n", _("If you don't have the package installed, you will need to download it from"));
   printf (" %s\n", _("http://www.activesw.com/people/steve/qstat.html before you can use this plugin."));
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
 
   printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_hpjd.c
===================================================================
--- nagiosplug/trunk/plugins/check_hpjd.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_hpjd.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -100,6 +100,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -390,19 +393,26 @@
 	printf (COPYRIGHT, copyright, email);
 
 	printf ("%s\n", _("This plugin tests the STATUS of an HP printer with a JetDirect card."));
-  printf ("%s\n", _("Net-snmp must be installed on the computer running the plugin."));
+	printf ("%s\n", _("Net-snmp must be installed on the computer running the plugin."));
 
-  printf ("\n\n");
+	printf ("\n\n");
 
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-C, --community=STRING");
-  printf ("    %s", _("The SNMP community name "));
-  printf (_("(default=%s)"), DEFAULT_COMMUNITY);
+	printf ("    %s", _("The SNMP community name "));
+	printf (_("(default=%s)"), DEFAULT_COMMUNITY);
+	printf ("\n");
 
-  printf ("\n");
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_http.c
===================================================================
--- nagiosplug/trunk/plugins/check_http.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_http.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -147,6 +147,9 @@
   asprintf (&user_agent, "User-Agent: check_http/%s (nagios-plugins %s)",
             clean_revstring (revision), VERSION);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
   if (process_arguments (argc, argv) == ERROR)
     usage4 (_("Could not parse arguments"));
 
@@ -1232,6 +1235,7 @@
   printf ("\n");
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-H, --hostname=ADDRESS");
   printf ("    %s\n", _("Host name argument for servers using host headers (virtual host)"));
@@ -1299,19 +1303,24 @@
 
   printf (_(UT_VERBOSE));
 
-  printf (_("Notes:"));
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
   printf (" %s\n", _("This plugin will attempt to open an HTTP connection with the host."));
   printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL"));
   printf (" %s\n", _("other errors return STATE_UNKNOWN.  Successful connects, but incorrect reponse"));
   printf (" %s\n", _("messages from the host result in STATE_WARNING return values.  If you are"));
   printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN"));
   printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument."));
+  printf ("\n");
+  printf (_(UT_EXTRA_OPTS_NOTES));
 
 #ifdef HAVE_SSL
+  printf ("\n");
   printf (" %s\n", _("This plugin can also check whether an SSL enabled web server is able to"));
   printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 "));
   printf (" %s\n", _("certificate is still valid for the specified number of days."));
-  printf (_("Examples:"));
+  printf ("\n");
+  printf ("%s\n", _("Examples:"));
   printf (" %s\n\n", "CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com");
   printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,"));
   printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds"));

Modified: nagiosplug/trunk/plugins/check_ide_smart.c
===================================================================
--- nagiosplug/trunk/plugins/check_ide_smart.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ide_smart.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -162,6 +162,9 @@
 	values_t values;
 	int fd;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	static struct option longopts[] = { 
 		{"device", required_argument, 0, 'd'}, 
 		{"immediate", no_argument, 0, 'i'}, 
@@ -490,6 +493,7 @@
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-d, --device=DEVICE");
   printf ("    %s\n", _("Select device DEVICE"));
@@ -504,6 +508,13 @@
   printf ("    %s\n", _("Turn off automatic offline tests"));
   printf (" %s\n", "-n, --nagios");
   printf ("    %s\n", _("Output suitable for Nagios"));
+
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_ldap.c
===================================================================
--- nagiosplug/trunk/plugins/check_ldap.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ldap.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -104,7 +104,10 @@
 	if (strstr(argv[0],"check_ldaps")) {
 		asprintf (&progname, "check_ldaps");
  	}
-	
+
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -392,11 +395,12 @@
 	printf ("Copyright (c) 1999 Didi Rieder ([email protected])\n");
 	printf (COPYRIGHT, copyright, email);
 
-  printf ("\n\n");
+	printf ("\n\n");
 
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -429,12 +433,17 @@
 
 	printf (_(UT_VERBOSE));
 
-	printf ("\n%s\n", _("Notes:"));
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
 	printf (" %s\n", _("If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"));
-	printf (_(" implied (using default port %i) unless --port=636 is specified. In that case %s"), DEFAULT_PORT, "\n");
+	printf (_(" implied (using default port %i) unless --port=636 is specified. In that case\n"), DEFAULT_PORT);
 	printf (" %s\n", _("'SSL on connect' will be used no matter how the plugin was called."));
 	printf (" %s\n", _("This detection is deprecated, please use 'check_ldap' with the '--starttls' or '--ssl' flags"));
 	printf (" %s\n", _("to define the behaviour explicitly instead."));
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_load.c
===================================================================
--- nagiosplug/trunk/plugins/check_load.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_load.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -119,6 +119,9 @@
 	textdomain (PACKAGE);
 	setlocale(LC_NUMERIC, "POSIX");
 
+	/* Parse extra opts if any */
+	argv = np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -307,6 +310,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-w, --warning=WLOAD1,WLOAD5,WLOAD15");
   printf ("    %s\n", _("Exit with WARNING status if load average exceeds WLOADn"));
@@ -316,6 +320,12 @@
   printf (" %s\n", "-r, --percpu");
   printf ("    %s\n", _("Divide the load averages by the number of CPUs (when possible)"));
 
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_mrtg.c
===================================================================
--- nagiosplug/trunk/plugins/check_mrtg.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_mrtg.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -72,6 +72,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments\n"));
 
@@ -327,6 +330,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-F, --logfile=FILE");
   printf ("   %s\n", _("The MRTG log file containing the data you want to monitor"));
@@ -367,6 +371,9 @@
   printf ("   %s\n", _("you can always hack the code to make this plugin work for you..."));
   printf (" %s\n", _("- MRTG stands for the Multi Router Traffic Grapher.  It can be downloaded from"));
   printf ("   %s\n", "http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html");
+#ifdef NP_EXTRA_OPTS
+	printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_mrtgtraf.c
===================================================================
--- nagiosplug/trunk/plugins/check_mrtgtraf.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_mrtgtraf.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -80,6 +80,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -347,6 +350,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-F, --filename=STRING");
   printf ("    %s\n", _("File to read log from"));
@@ -368,6 +372,9 @@
   printf (" %s\n", _("- The calculated i/o rates are a little off from what MRTG actually"));
   printf (" %s\n", _("  reports.  I'm not sure why this is right now, but will look into it"));
   printf (" %s\n", _("  for future enhancements of this plugin."));
+#ifdef NP_EXTRA_OPTS
+	printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_mysql.c
===================================================================
--- nagiosplug/trunk/plugins/check_mysql.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_mysql.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -82,6 +82,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -385,6 +388,7 @@
 	print_usage ();
 
   printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
   printf (_(UT_HOST_PORT), 'P', myport);
   printf (" %s\n", "-s, --socket=STRING");
@@ -412,6 +416,12 @@
   printf (" %s\n", _("using the default unix socket. You can force TCP on localhost by using an"));
   printf (" %s\n", _("IP address or FQDN ('localhost' will use the socket as well)."));
 
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_mysql_query.c
===================================================================
--- nagiosplug/trunk/plugins/check_mysql_query.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_mysql_query.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -78,6 +78,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -294,6 +297,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 	printf (" -q, --query=STRING\n");
 	printf ("    %s\n", _("SQL query to run. Only first column in first row will be read"));
 	printf (_(UT_WARN_CRIT_RANGE));
@@ -313,6 +317,12 @@
 	printf (" %s\n", _("A query is required. The result from the query should be numeric."));
 	printf (" %s\n", _("For extra security, create a user with minimal access."));
 
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_nagios.c
===================================================================
--- nagiosplug/trunk/plugins/check_nagios.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_nagios.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -88,6 +88,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage_va(_("Could not parse arguments"));
 
@@ -289,6 +292,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-F, --filename=FILE");
   printf ("    %s\n", _("Name of the log file to check"));
@@ -297,7 +301,14 @@
   printf (" %s\n", "-C, --command=STRING");
   printf ("    %s\n", _("Substring to search for in process arguments"));
   printf (_(UT_VERBOSE));
+
+#ifdef NP_EXTRA_OPTS
   printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
+  printf ("\n");
   printf ("%s\n", _("Examples:"));
   printf (" %s\n", "check_nagios -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios");
 

Modified: nagiosplug/trunk/plugins/check_nt.c
===================================================================
--- nagiosplug/trunk/plugins/check_nt.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_nt.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -122,6 +122,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if(process_arguments(argc,argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -644,8 +647,9 @@
 	print_usage();
 	
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
-    printf ("%s\n", _("Options:"));
+  printf ("%s\n", _("Options:"));
   printf (" %s\n", "-H, --hostname=HOST");
   printf ("   %s\n", _("Name of the host to check"));
   printf (" %s\n", "-p, --port=INTEGER");
@@ -729,6 +733,9 @@
   printf ("   %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\"."));
   printf ("   %s\n", _("One fix for this is to change the port to something else on check_nt "));
   printf ("   %s\n", _("and on the client service it\'s connecting to."));
+#ifdef NP_EXTRA_OPTS
+  printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
+#endif
 
   printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_ntp.c
===================================================================
--- nagiosplug/trunk/plugins/check_ntp.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ntp.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -763,6 +763,9 @@
 
 	result = offset_result = jitter_result = STATE_OK;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -844,6 +847,7 @@
 
 	print_usage();
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 	printf (_(UT_HOST_PORT), 'p', "123");
 	printf (" %s\n", "-w, --warning=THRESHOLD");
 	printf ("    %s\n", _("Offset to result in warning status (seconds)"));
@@ -859,11 +863,16 @@
 	printf("\n");
 	printf("%s\n", _("Notes:"));
 	printf(_(UT_THRESHOLDS_NOTES));
+#ifdef NP_EXTRA_OPTS
+	printf("\n");
+	printf(_(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf("\n");
 	printf("%s\n", _("Examples:"));
 	printf(" %s\n", _("Normal offset check:"));
 	printf("  %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1"));
+	printf("\n");
 	printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available"));
 	printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
 	printf("  %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));

Modified: nagiosplug/trunk/plugins/check_ntp_peer.c
===================================================================
--- nagiosplug/trunk/plugins/check_ntp_peer.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ntp_peer.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -552,6 +552,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -638,6 +641,7 @@
 
 	print_usage();
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 	printf (_(UT_HOST_PORT), 'p', "123");
 	printf (" %s\n", "-q, --quiet");
 	printf ("    %s\n", _("Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"));
@@ -664,17 +668,23 @@
 	printf(" %s\n", _("Use this plugin to check the health of an NTP server. It supports"));
 	printf(" %s\n", _("checking the offset with the sync peer, the jitter and stratum. This"));
 	printf(" %s\n", _("plugin will not check the clock offset between the local host and NTP"));
-	printf(" %s\n\n", _("server; please use check_ntp_time for that purpose."));
-
+	printf(" %s\n", _("server; please use check_ntp_time for that purpose."));
+	printf("\n");
 	printf(_(UT_THRESHOLDS_NOTES));
+#ifdef NP_EXTRA_OPTS
+	printf("\n");
+	printf(_(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf("\n");
 	printf("%s\n", _("Examples:"));
 	printf(" %s\n", _("Simple NTP server check:"));
 	printf("  %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1"));
+	printf("\n");
 	printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available"));
 	printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
 	printf("  %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
+	printf("\n");
 	printf(" %s\n", _("Check only stratum:"));
 	printf("  %s\n", ("./check_ntp_peer -H ntpserv -W 4 -C 6"));
 

Modified: nagiosplug/trunk/plugins/check_ntp_time.c
===================================================================
--- nagiosplug/trunk/plugins/check_ntp_time.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ntp_time.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -540,6 +540,9 @@
 
 	result = offset_result = STATE_OK;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -597,6 +600,7 @@
 
 	print_usage();
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 	printf (_(UT_HOST_PORT), 'p', "123");
 	printf (" %s\n", "-q, --quiet");
 	printf ("    %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found"));
@@ -610,13 +614,18 @@
 	printf("\n");
 	printf("%s\n", _("This plugin checks the clock offset between the local host and a"));
 	printf("%s\n", _("remote NTP server. It is independent of any commandline programs or"));
-	printf("%s\n\n", _("external libraries."));
+	printf("%s\n", _("external libraries."));
 
+	printf("\n");
 	printf("%s\n", _("Notes:"));
 	printf(" %s\n", _("If you'd rather want to monitor an NTP server, please use"));
-	printf(" %s\n\n", _("check_ntp_peer."));
-
+	printf(" %s\n", _("check_ntp_peer."));
+	printf("\n");
 	printf(_(UT_THRESHOLDS_NOTES));
+#ifdef NP_EXTRA_OPTS
+	printf("\n");
+	printf(_(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf("\n");
 	printf("%s\n", _("Examples:"));

Modified: nagiosplug/trunk/plugins/check_nwstat.c
===================================================================
--- nagiosplug/trunk/plugins/check_nwstat.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_nwstat.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -170,6 +170,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts(&argc, argv, progname);
+
 	if (process_arguments(argc,argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -1607,6 +1610,7 @@
 	print_usage();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -1674,6 +1678,9 @@
   printf (" %s\n", _("- Values for critical thresholds should be lower than warning thresholds"));
   printf (" %s\n", _("  when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "));
   printf (" %s\n", _("  TCB, LRUS and LRUM."));
+#ifdef NP_EXTRA_OPTS
+  printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_overcr.c
===================================================================
--- nagiosplug/trunk/plugins/check_overcr.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_overcr.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -99,6 +99,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -425,6 +428,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -445,17 +449,22 @@
 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
 
   printf (_(UT_VERBOSE));
+
   printf ("\n");
-  printf ("%s\n", _("Notes:"));
-
-  printf (" %s\n", _("For the available options, the critical threshold value should always be"));
-  printf (" %s\n\n", _("higher than the warning threshold value, EXCEPT with the uptime variable"));
-
-  printf ("%s\n", _("This plugin requres that Eric Molitors' Over-CR collector daemon be"));
+  printf ("%s\n", _("This plugin requires that Eric Molitors' Over-CR collector daemon be"));
   printf ("%s\n", _("running on the remote server."));
   printf ("%s\n", _("Over-CR can be downloaded from http://www.molitor.org/overcr"));
   printf ("%s\n", _("This plugin was tested with version 0.99.53 of the Over-CR collector"));
 
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (" %s\n", _("For the available options, the critical threshold value should always be"));
+  printf (" %s\n", _("higher than the warning threshold value, EXCEPT with the uptime variable"));
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_pgsql.c
===================================================================
--- nagiosplug/trunk/plugins/check_pgsql.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_pgsql.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -150,6 +150,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -412,6 +415,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'P', myport);
 
@@ -447,6 +451,12 @@
   printf (" %s\n", _("able to connect to the database without a password. The plugin can also send"));
   printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password."));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_ping.c
===================================================================
--- nagiosplug/trunk/plugins/check_ping.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ping.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -92,6 +92,9 @@
 	addresses = malloc (sizeof(char*) * max_addr);
 	addresses[0] = NULL;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -564,6 +567,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_IPv46));
 
@@ -592,6 +596,12 @@
   printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"));
   printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/"));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_procs.c
===================================================================
--- nagiosplug/trunk/plugins/check_procs.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_procs.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -143,6 +143,9 @@
 	asprintf (&metric_name, "PROCS");
 	metric = METRIC_PROCS;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -715,13 +718,12 @@
 
 	print_usage ();
 
-	printf ("%s\n", _("Required Arguments:"));
+  printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
   printf (" %s\n", "-w, --warning=RANGE");
   printf ("   %s\n", _("Generate warning state if metric is outside this range"));
   printf (" %s\n", "-c, --critical=RANGE");
   printf ("   %s\n", _("Generate critical state if metric is outside this range"));
-
-	printf ("%s\n", _("Optional Arguments:"));
   printf (" %s\n", "-m, --metric=TYPE");
   printf ("  %s\n", _("Check thresholds against metric. Valid types:"));
   printf ("  %s\n", _("PROCS   - number of processes (default)"));
@@ -737,7 +739,8 @@
 	printf (" %s\n", "-v, --verbose");
   printf ("    %s\n", _("Extra information. Up to 3 verbosity levels"));
 
-	printf ("%s\n", "Optional Filters:");
+  printf ("\n");
+	printf ("%s\n", "Filters:");
   printf (" %s\n", "-s, --state=STATUSFLAGS");
   printf ("   %s\n", _("Only scan for processes that have, in the output of `ps`, one or"));
   printf ("   %s\n", _("more of the status flags you specify (for example R, Z, S, RS,"));
@@ -771,6 +774,12 @@
 process owner, parent process PID, current state (e.g., 'Z'), or may\n\
 be the total number of running processes\n\n"));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+  printf ("\n");
+#endif
+
 	printf ("%s\n", _("Examples:"));
   printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry");
   printf ("  %s\n", _("Warning if not two processes with command name portsentry."));

Modified: nagiosplug/trunk/plugins/check_radius.c
===================================================================
--- nagiosplug/trunk/plugins/check_radius.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_radius.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -149,6 +149,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -315,6 +318,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'P', myport);
 
@@ -344,6 +348,12 @@
   printf ("%s\n", _("run the plugin at regular predictable intervals.  Please be sure that"));
   printf ("%s\n", _("the password used does not allow access to sensitive system resources."));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_real.c
===================================================================
--- nagiosplug/trunk/plugins/check_real.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_real.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -77,6 +77,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -418,6 +421,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -440,6 +444,12 @@
   printf ("%s\n", _("but incorrect reponse messages from the host result in STATE_WARNING return"));
   printf ("%s\n", _("values."));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_smtp.c
===================================================================
--- nagiosplug/trunk/plugins/check_smtp.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_smtp.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -137,6 +137,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -771,6 +774,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -812,6 +816,12 @@
   printf ("%s\n", _("connects, but incorrect reponse messages from the host result in"));
   printf ("%s\n", _("STATE_WARNING return values."));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_snmp.c
===================================================================
--- nagiosplug/trunk/plugins/check_snmp.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_snmp.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -176,6 +176,9 @@
 	timeout_interval = DEFAULT_TIMEOUT;
 	retries = DEFAULT_RETRIES;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -932,6 +935,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', DEFAULT_PORT);
 
@@ -1017,6 +1021,9 @@
   printf (" %s\n", _("- Note that only one string and one regex may be checked at present"));
   printf (" %s\n", _("- All evaluation methods other than PR, STR, and SUBSTR expect that the value"));
   printf ("   %s\n", _("returned from the SNMP query is an unsigned integer."));
+#ifdef NP_EXTRA_OPTS
+  printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_ssh.c
===================================================================
--- nagiosplug/trunk/plugins/check_ssh.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ssh.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -70,6 +70,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -281,6 +284,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -293,6 +297,12 @@
 	
 	printf (_(UT_VERBOSE));
 
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_swap.c
===================================================================
--- nagiosplug/trunk/plugins/check_swap.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_swap.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -107,6 +107,9 @@
 
 	status = strdup ("");
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -530,6 +533,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-w, --warning=INTEGER");
   printf ("    %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free"));
@@ -546,7 +550,12 @@
 	printf ("\n");
   printf ("%s\n", _("Notes:"));
   printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."));
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
 
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_tcp.c
===================================================================
--- nagiosplug/trunk/plugins/check_tcp.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_tcp.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -205,6 +205,9 @@
 	server_quit = QUIT;
 	status = NULL;
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -602,6 +605,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', "none");
 
@@ -642,6 +646,12 @@
 
 	printf (_(UT_VERBOSE));
 
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_time.c
===================================================================
--- nagiosplug/trunk/plugins/check_time.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_time.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -75,6 +75,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -344,6 +347,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -359,6 +363,13 @@
   printf ("   %s\n", _("Response time (sec.) necessary to result in critical status"));
 
 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
+
+#ifdef NP_EXTRA_OPTS
+	printf ("\n");
+	printf ("%s\n", _("Notes:"));
+	printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/check_ups.c
===================================================================
--- nagiosplug/trunk/plugins/check_ups.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_ups.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -119,6 +119,9 @@
 	data = strdup ("");
 	message = strdup ("");
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -609,6 +612,7 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_HOST_PORT), 'p', myport);
 
@@ -640,12 +644,15 @@
   printf (" %s\n", _("battery load, etc.)  as well as warning and critical thresholds for the value"));
   printf (" %s\n", _("of that variable.  If the remote host has multiple UPS that are being monitored"));
   printf (" %s\n", _("you will have to use the --ups option to specify which UPS to check."));
-
   printf ("\n");
   printf (" %s\n", _("This plugin requires that the UPSD daemon distributed with Russel Kroll's"));
   printf (" %s\n", _("Smart UPS Tools be installed on the remote host. If you do not have the"));
   printf (" %s\n", _("package installed on your system, you can download it from"));
   printf (" %s\n", _("http://www.networkupstools.org"));
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
 
 	printf (_(UT_SUPPORT));
 }

Modified: nagiosplug/trunk/plugins/check_users.c
===================================================================
--- nagiosplug/trunk/plugins/check_users.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/check_users.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -65,6 +65,9 @@
 
 	perf = strdup("");
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts (&argc, argv, progname);
+
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 
@@ -213,12 +216,19 @@
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (" %s\n", "-w, --warning=INTEGER");
   printf ("    %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
   printf (" %s\n", "-c, --critical=INTEGER");
   printf ("    %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
 	printf (_(UT_SUPPORT));
 }
 

Modified: nagiosplug/trunk/plugins/utils.h
===================================================================
--- nagiosplug/trunk/plugins/utils.h	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins/utils.h	2008-05-07 10:02:42 UTC (rev 1991)
@@ -16,6 +16,14 @@
 /* now some functions etc are being defined in ../lib/utils_base.c */
 #include "utils_base.h"
 
+#ifdef NP_EXTRA_OPTS
+/* Include extra-opts functions if compiled in */
+#include "extra_opts.h"
+#else
+/* else, fake np_extra_opts */
+#define np_extra_opts(acptr,av,pr) av
+#endif
+
 /* Standardize version information, termination */
 
 /* $Id$ */
@@ -173,6 +181,17 @@
  -t, --timeout=INTEGER\n\
     Seconds before connection times out (default: %d)\n"
 
+#ifdef NP_EXTRA_OPTS
+#define UT_EXTRA_OPTS "\
+ --extra-opts=[section][@file]\n\
+    Read additionnal options from ini file\n"
+#define UT_EXTRA_OPTS_NOTES "\
+ See: http://nagiosplugins.org/extra-opts for --extra-opts usage and examples.\n"
+#else
+#define UT_EXTRA_OPTS ""
+#define UT_EXTRA_OPTS_NOTES ""
+#endif
+
 #define UT_THRESHOLDS_NOTES "\
  See:\n\
  http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT\n\

Modified: nagiosplug/trunk/plugins-root/check_dhcp.c
===================================================================
--- nagiosplug/trunk/plugins-root/check_dhcp.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins-root/check_dhcp.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -268,6 +268,9 @@
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts(&argc, argv, progname);
+
 	if(process_arguments(argc,argv)!=OK){
 		usage4 (_("Could not parse arguments"));
 		}
@@ -1395,6 +1398,7 @@
 	print_usage();
 
 	printf (_(UT_HELP_VRSN));
+	printf (_(UT_EXTRA_OPTS));
 
 	printf (_(UT_VERBOSE));
 
@@ -1411,6 +1415,12 @@
   printf (" %s\n", "-u, --unicast");
   printf ("    %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
 
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf ("%s\n", _("Notes:"));
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
   printf (_(UT_SUPPORT));
 	return;
 	}

Modified: nagiosplug/trunk/plugins-root/check_icmp.c
===================================================================
--- nagiosplug/trunk/plugins-root/check_icmp.c	2008-05-07 10:01:48 UTC (rev 1990)
+++ nagiosplug/trunk/plugins-root/check_icmp.c	2008-05-07 10:02:42 UTC (rev 1991)
@@ -447,6 +447,9 @@
 		packets = 5;
 	}
 
+	/* Parse extra opts if any */
+	argv=np_extra_opts(&argc, argv, progname);
+
 	/* parse the arguments */
 	for(i = 1; i < argc; i++) {
 		while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) {
@@ -1262,6 +1265,7 @@
   print_usage ();
 
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
   printf (" %s\n", "-H");
   printf ("    %s\n", _("specify a target"));
@@ -1310,10 +1314,13 @@
   printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/
   printf ("\n");
   printf (" %s\n", _("The -v switch can be specified several times for increased verbosity."));
-
 /*  printf ("%s\n", _("Long options are currently unsupported."));
   printf ("%s\n", _("Options marked with * require an argument"));
 */
+#ifdef NP_EXTRA_OPTS
+  printf ("\n");
+  printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
 
   printf (_(UT_SUPPORT));
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.