summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d15788)
raw | patch | inline | side by side (parent: 4d15788)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Wed, 7 May 2008 10:02:42 +0000 (10:02 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Wed, 7 May 2008 10:02:42 +0000 (10:02 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
40 files changed:
index 9b62b3e22e26ad173ec46517d3ee85748e29d315..241f13ed90f9daa6c2d7dd897dae9b8e5c0c7a5c 100644 (file)
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"));
}
print_usage();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_VERBOSE));
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;
}
index a059f266629f3ae339f96ea9a3e53f278c929866..f3e5f0d3242414dda9779794df0d442aebdb5a1d 100644 (file)
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) {
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (" %s\n", "-H");
printf (" %s\n", _("specify a target"));
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));
}
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index bd59c7069d1b6bb51c5e44933ac8e12cd6e98220..440755d6e28122217c4a98fe5ffb363604463422 100644 (file)
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
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"));
print_usage();
printf(_(UT_HELP_VRSN));
+ printf(_(UT_EXTRA_OPTS));
printf(_(UT_TIMEOUT), timeout_interval);
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));
}
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 37874bf8ccaed50718929be10061857f26adc2b6..9def404dd15def11d316defff44580754bc3ccb9 100644 (file)
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
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"));
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
+
printf (_(UT_HOST_PORT), 'p', "none");
printf (_(UT_IPv46));
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));
}
index ac3eeceb0eebce9b891af4e8ae218aaaee7e8971..d49314995b5b2a3c0f42d5fafbd6c13ff8cb4f5f 100644 (file)
--- a/plugins/check_cluster.c
+++ b/plugins/check_cluster.c
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"));
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");
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));
}
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index d7e1f579368670a890f7d8ae6c7d143ff2fa75d8..e3f7adbd394218cebbdc49761275bab391b7e7dc 100644 (file)
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
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"));
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
+
printf (_(UT_HOST_PORT), 'p', myport);
printf (" %s\n","-l, --query_address=STRING");
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));
}
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 7048a561b6ba8cbb56561cf49ca4fb92b485f2de..e9e7219007091d4d206efc92b07403b43c149da2 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
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"));
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"));
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 /");
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index f8dbb4dc8364735df4c6ab797ad006053c450a52..13840646227b9904ad1b1fa8041b26bb5fc87565 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
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"));
}
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"));
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));
}
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 8617871a844d117dba206b5a524e87cfac3e9e87..5a0ab8cc08fb436ba17cd4a7ab02c4a899a0e953 100644 (file)
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
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"));
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)"));
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));
}
diff --git a/plugins/check_game.c b/plugins/check_game.c
index 0e4120dda41516db54238c55af7cddc49c74d7f2..4bc57c8f3b635b520132f7b90629c9f168568a5d 100644 (file)
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (" %s\n", "-p");
printf (" %s\n", _("Optional port of which to connect"));
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));
}
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index e20a76d9f2b9a6054d340096b7964d635bf18d7f..044f08f64a4a2025a044f359a7c2810594e5484c 100644 (file)
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
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"));
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");
+
+#ifdef NP_EXTRA_OPTS
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
- printf ("\n");
printf (_(UT_SUPPORT));
}
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 81071d756b554d7b3bcfa79ef6a56d2fa664e907..42636cd02c81b0e77f97cd3589ff090b8d97c112 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
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"));
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)"));
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"));
index 937f84c51c23bbe55300b274c6cadf8b1210854b..02f07c012d3140dab0395b6129559d65ec114cc0 100644 (file)
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'},
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (" %s\n", "-d, --device=DEVICE");
printf (" %s\n", _("Select device DEVICE"));
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));
}
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 74ca3b0ce3ac35e12a4366d251f04da4dc20dfa0..3d6f05c4352f566cb98f8057392b91c7dbae1c16 100644 (file)
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
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"));
printf ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\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);
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));
}
diff --git a/plugins/check_load.c b/plugins/check_load.c
index f4faa31b6f512a51ee4e292c5bdf2fc70cc29b9c..5ff9a8c0517d9d25a95d7ec2d686b6b298f7f3af 100644 (file)
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
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"));
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"));
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));
}
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index cf77f8bfe0cba87e57ac77a722b11750c0b7315a..80e52155d10ded2816b70d09586344e98dae17a3 100644 (file)
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
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"));
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"));
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));
}
index 5ba5cdc082bbd5d3e2089339de6f0e90f27bbc0a..b97161649fbef0e3d686e4762b38e841af93f5fe 100644 (file)
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (" %s\n", "-F, --filename=STRING");
printf (" %s\n", _("File to read log from"));
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));
}
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 3d7426d81db23c967164753a937680eaa97da7d3..a9f0f600bc9964d2d81ceba735c6f0a4c09a12f7 100644 (file)
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'P', myport);
printf (" %s\n", "-s, --socket=STRING");
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));
}
index 171fc69fab3e8eeeeec60d8c3e345fbdf7be035c..6c5e436798c5c9b205a66bf477f67814640a71c1 100644 (file)
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"));
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));
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));
}
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 1f8df33e8980fa8fb6e9e4c514de56ade1a4d2f1..dfe60808084c5d6a1b52d344c62dd82a732cc607 100644 (file)
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
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"));
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"));
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");
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 681b842e4a655efa4d98687b58b34b6f25ff4725..ef1b530dd3f4fc321d39a7165a22e4e437a76ebb 100644 (file)
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
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"));
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");
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));
}
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 69c25f0e227a3cdd620c3fdab685cdee21ed5bb9..68c82d1154655907b4b7e8df8221d8b1de1e2594 100644 (file)
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
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"));
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)"));
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"));
index 5ed97db24f514fd30569a7cd6d96328e68f25422..67ee0a77a7079e720a6d335fadb576fc2ceed534 100644 (file)
--- a/plugins/check_ntp_peer.c
+++ b/plugins/check_ntp_peer.c
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"));
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"));
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"));
index ec41429e96365ee148005c3d6d12e6fd9d3c382f..ea24a0e7f9f3f6e301e4c04b36c9114969767268 100644 (file)
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
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"));
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"));
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:"));
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 3c8d5b9647b294e5f3329b047337015bd8211684..b4fd3c733cf50ddf6c6304321ac20f0e930e02df 100644 (file)
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
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"));
print_usage();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
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));
}
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 6c3675bf7de65234ac4b47d9ede4d94fcc33468a..af04d3b4c02f8f2442c3102222792944265bd5fe 100644 (file)
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
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 ("\n");
+ 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));
}
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index c721b07c84e3d162707f5811fdaba1a081337c50..1a93f6bf17e27898b17f370685149fdc6275a220 100644 (file)
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'P', myport);
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));
}
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index e22856dab48d88ac06fbbf74657304a743b64172..0f3292d0feebc68556e83e8e9eb4a66f02d1789f 100644 (file)
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_IPv46));
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));
}
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 816da1b7af5d61fb9a2a7fe5e07ad65124410fe3..875f867fe657d049d4b70c5e0b2369276a33cfd8 100644 (file)
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
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"));
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)"));
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,"));
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."));
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 2afe3c8897aecfe6e496144780c47311b4300fe8..7ce820a875301d6fb6e1d9060340f435d705e92e 100644 (file)
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'P', myport);
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));
}
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 68a6c1e284c44c7aa29783b95718d2cb1985e229..d333c2a3c8509172b25dde74f37c07f5f0eff207 100644 (file)
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
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));
}
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index b1fc7ee0740eab80bb1854a71ce1654c9023f845..8ff10b82a9d9f2a6ea4f9e36115e472b719b87d7 100644 (file)
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
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));
}
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index b9435651707f42f4e8acf5a247e01fb772b8b769..0acade256e8159f79b8db00cf62f84ed98a18a41 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', DEFAULT_PORT);
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));
}
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index 869b803ea90b8afe2ee612398ce023944755d80d..4b5f6b763f9585490dbd88dbf0d927ff23ce72eb 100644 (file)
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
printf (_(UT_VERBOSE));
+#ifdef NP_EXTRA_OPTS
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
printf (_(UT_SUPPORT));
}
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 1c627ac73238afda4c2b4bdb2a285e386d2ab3a2..04cc1aee4c22c93a76f9ce79f3d1c23605bd807b 100644 (file)
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
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"));
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"));
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));
}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index d74b5a8b342d01c2e854907698330a793cbdb66a..3ad31318fb8ba835ea592339e9601e92029ba86b 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', "none");
printf (_(UT_VERBOSE));
+#ifdef NP_EXTRA_OPTS
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
+
printf (_(UT_SUPPORT));
}
diff --git a/plugins/check_time.c b/plugins/check_time.c
index acfc3ef77be665a30d17e8d0e8aec530a74e9dd1..b6d9e38a9ae318de3de5ee85d65f624ec98605ab 100644 (file)
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
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));
}
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 666485ee449a70caca8197416a0f964b4f731eee..773da5f4d860525256b9fba913f80222ec410333 100644 (file)
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
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"));
print_usage ();
printf (_(UT_HELP_VRSN));
+ printf (_(UT_EXTRA_OPTS));
printf (_(UT_HOST_PORT), 'p', myport);
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));
}
diff --git a/plugins/check_users.c b/plugins/check_users.c
index c81822bddd9328ec8365061a9946d5fcf70d13c8..e4ef681f6075227e38d2030692a43debddb1b9f8 100644 (file)
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
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"));
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));
}
diff --git a/plugins/utils.h b/plugins/utils.h
index def89705c7c1e4424b0d1315c603cfcf8ec4c80f..67e099d41ad787bff1e5a83ba719c645ede8b803 100644 (file)
--- a/plugins/utils.h
+++ b/plugins/utils.h
/* 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$ */
-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\