From cbbfed30eb01a702b2e61c0abcb64c834e73d654 Mon Sep 17 00:00:00 2001 From: Benoit Mortier Date: Sat, 17 Jun 2006 12:28:43 +0000 Subject: cleaning up help and usage git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1433 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index b281c33..632237a 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c @@ -19,7 +19,7 @@ const char *progname = "check_hpjd"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -374,17 +374,18 @@ print_help (void) printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); - printf (_("\ -This plugin tests the STATUS of an HP printer with a JetDirect card.\n\ -Net-snmp must be installed on the computer running the plugin.\n\n")); + 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 ("\n\n"); + print_usage (); printf (_(UT_HELP_VRSN)); - printf (_("\ - -C, --community=STRING\n\ - The SNMP community name (default=%s)\n"), DEFAULT_COMMUNITY); + printf (" %s\n", "-C, --community=STRING"); + printf (" %s", _("The SNMP community name ")); + printf (_("(default=%s)"), DEFAULT_COMMUNITY); printf (_(UT_SUPPORT)); } @@ -394,5 +395,6 @@ Net-snmp must be installed on the computer running the plugin.\n\n")); void print_usage (void) { - printf ("Usage: %s -H host [-C community]\n", progname); + printf (_("Usage:")); + printf ("%s -H host [-C community]\n", progname); } diff --git a/plugins/check_nt.c b/plugins/check_nt.c index 1bdddc4..2505a0b 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c @@ -32,7 +32,7 @@ const char *progname = "check_nt"; const char *revision = "$Revision$"; -const char *copyright = "2003-2004"; +const char *copyright = "2003-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -614,11 +614,15 @@ void print_help(void) printf ("Copyright (c) 2000 Yves Rubin (rubiyz@yahoo.com)\n"); printf (COPYRIGHT, copyright, email); - printf (_("This plugin collects data from the NSClient service running on a\n\ -Windows NT/2000/XP/2003 server.\n\n")); + printf ("%s\n", _("This plugin collects data from the NSClient service running on a")); + printf ("%s\n", _("Windows NT/2000/XP/2003 server.")); + printf ("\n\n"); + print_usage(); + printf (_(UT_HELP_VRSN)); + printf (_("\nOptions:\n\ -H, --hostname=HOST\n\ Name of the host to check\n\ @@ -689,7 +693,7 @@ Windows NT/2000/XP/2003 server.\n\n")); void print_usage(void) { - printf("\ -Usage: %s -H host -v variable [-p port] [-w warning] [-c critical]\n\ - [-l params] [-d SHOWALL] [-t timeout]\n", progname); + printf (_("Usage:")); + printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]",progname); + printf ("[-l params] [-d SHOWALL] [-t timeout]\n"); } diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 655dd4f..9cda277 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c @@ -768,23 +768,29 @@ int main(int argc, char *argv[]){ } -void print_usage(void){ - printf("\ -Usage: %s -H [-O] [-w ] [-c ] [-j ] [-k ] [-v verbose]\ -\n", progname); -} void print_help(void){ print_revision(progname, revision); printf ("Copyright (c) 1999 Ethan Galstad\n"); printf (COPYRIGHT, copyright, email); + + printf ("%s\n", _("This plugin checks the selected ntp server")); + printf ("\n\n"); + print_usage(); printf (_(UT_HELP_VRSN)); printf (_(UT_HOST_PORT), 'p', "123"); printf (_(UT_WARN_CRIT)); printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); printf (_(UT_VERBOSE)); - printf(_(UT_SUPPORT)); + printf (_(UT_SUPPORT)); +} + +void +print_usage(void) +{ + printf (_("Usage:")); + printf("%s -H [-O] [-w ] [-c ] [-j ] [-k ] [-v verbose]\n", progname); } diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c index 6465dae..7495cae 100644 --- a/plugins/check_nwstat.c +++ b/plugins/check_nwstat.c @@ -20,7 +20,7 @@ const char *progname = "check_nwstat"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -1013,9 +1013,10 @@ void print_help(void) printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); - printf (_("\ -This plugin attempts to contact the MRTGEXT NLM running on a\n\ -Novell server to gather the requested system information.\n\n")); + printf ("%s\n", _("This plugin attempts to contact the MRTGEXT NLM running on a")); + printf ("%s\n", _("Novell server to gather the requested system information.")); + + printf ("\n\n"); print_usage(); @@ -1076,8 +1077,9 @@ Novell server to gather the requested system information.\n\n")); printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); - printf (_("\n\ -Notes:\n\ + printf ("\n"); + printf ("%s\n", _("Notes:")); + printf (_("\ - This plugin requres that the MRTGEXT.NLM file from James Drews' MRTG\n\ extension for NetWare be loaded on the Novell servers you wish to check.\n\ (available from http://www.engr.wisc.edu/~drews/mrtg/)\n\ @@ -1092,7 +1094,6 @@ Notes:\n\ void print_usage(void) { - printf ("\ -Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\ - [-t timeout].\n", progname); + printf (_("Usage:")); + printf ("%s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n",progname); } diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c index a4abf2b..490490e 100644 --- a/plugins/check_overcr.c +++ b/plugins/check_overcr.c @@ -20,7 +20,7 @@ const char *progname = "check_overcr"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -403,9 +403,10 @@ print_help (void) printf ("Copyright (c) 1999 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); - printf (_("\ -This plugin attempts to contact the Over-CR collector daemon running on the\n\ -remote UNIX server in order to gather the requested system information.\n\n")); + printf ("%s\n", _("This plugin attempts to contact the Over-CR collector daemon running on the")); + printf ("%s\n", _("remote UNIX server in order to gather the requested system information.")); + + printf ("\n\n"); print_usage (); @@ -413,35 +414,33 @@ remote UNIX server in order to gather the requested system information.\n\n")); printf (_(UT_HOST_PORT), 'p', myport); - printf (_("\ --v, --variable=STRING\n\ - Variable to check. Valid variables include:\n\ - LOAD1 = 1 minute average CPU load\n\ - LOAD5 = 5 minute average CPU load\n\ - LOAD15 = 15 minute average CPU load\n\ - DPU = percent used disk space on filesystem \n\ - PROC = number of running processes with name \n\ - NET = number of active connections on TCP port \n\ - UPTIME = system uptime in seconds\n")); - - printf (_("\ - -w, --warning=INTEGER\n\ - Threshold which will result in a warning status\n\ - -c, --critical=INTEGER\n\ - Threshold which will result in a critical status\n")); + printf (" %s\n", "-w, --warning=INTEGER"); + printf (" %s\n", _("Threshold which will result in a warning status")); + printf (" %s\n", "-c, --critical=INTEGER"); + printf (" %s\n", _("Threshold which will result in a critical status")); + printf (" %s\n", "-v, --variable=STRING"); + printf (" %s\n", _("Variable to check. Valid variables include:")); + printf (" %s\n", _("LOAD1 = 1 minute average CPU load")); + printf (" %s\n", _("LOAD5 = 5 minute average CPU load")); + printf (" %s\n", _("LOAD15 = 15 minute average CPU load")); + printf (" %s\n", _("DPU = percent used disk space on filesystem ")); + printf (" %s\n", _("PROC = number of running processes with name ")); + printf (" %s\n", _("NET = number of active connections on TCP port ")); + printf (" %s\n", _("UPTIME = system uptime in seconds")); printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); - printf (_("\ -Notes:\n\ - - For the available options, the critical threshold value should always be\n\ - higher than the warning threshold value, EXCEPT with the uptime variable\n\n")); + 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 (_("\ - - This plugin requres that Eric Molitors' Over-CR collector daemon be\n\ - running on the remote server. Over-CR can be downloaded from\n\ - http://www.molitor.org/overcr (This plugin was tested with version\n\ - 0.99.53 of the Over-CR collector)\n\n")); + printf ("%s\n", _("This plugin requres that Eric Molitors' Over-CR collector daemon be")); + printf ("%s\n", _("running on the remote server. Over-CR can be downloaded from")); + printf ("%s\n", _("http://www.molitor.org/overcr (This plugin was tested with version 0.99.53")); + printf ("%s\n", _("of the Over-CR collector)")); printf (_(UT_SUPPORT)); } @@ -450,7 +449,6 @@ Notes:\n\ void print_usage (void) { - printf ("\ -Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\ - [-t timeout]\n", progname); + printf (_("Usage:")); + printf ("%s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n", progname); } diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 8cfc1ab..f258708 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c @@ -20,7 +20,7 @@ const char *progname = "check_pgsql"; const char *revision = "$Revision$"; -const char *copyright = "1999-2004"; +const char *copyright = "1999-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -391,7 +391,9 @@ print_help (void) printf (COPYRIGHT, copyright, email); - printf (_("Test whether a PostgreSQL Database is accepting connections.\n\n")); + printf (_("Test whether a PostgreSQL Database is accepting connections.")); + + printf ("\n\n"); print_usage (); @@ -401,13 +403,13 @@ print_help (void) printf (_(UT_IPv46)); - printf (_("\ - -d, --database=STRING\n\ - Database to check (default: %s)\n\ - -l, --logname = STRING\n\ - Login name of user\n\ - -p, --password = STRING\n\ - Password (BIG SECURITY ISSUE)\n"), DEFAULT_DB); + printf (" %s\n", "-d, --database=STRING"); + printf (" %s", _("Database to check ")); + printf (_("(default: %s)"), DEFAULT_DB); + printf (" %s\n", "-l, --logname = STRING"); + printf (" %s\n", _("Login name of user")); + printf (" %s\n", "-p, --password = STRING"); + printf (" %s\n", _("Password (BIG SECURITY ISSUE)")); printf (_(UT_WARN_CRIT)); @@ -415,21 +417,19 @@ print_help (void) printf (_(UT_VERBOSE)); - printf (_("\nAll parameters are optional.\n\ -\n\ -This plugin tests a PostgreSQL DBMS to determine whether it is active and\n\ -accepting queries. In its current operation, it simply connects to the\n\ -specified database, and then disconnects. If no database is specified, it\n\ -connects to the template1 database, which is present in every functioning \n\ -PostgreSQL DBMS.\n")); - printf (_("\n\ -The plugin will connect to a local postmaster if no host is specified. To\n\ -connect to a remote host, be sure that the remote postmaster accepts TCP/IP\n\ -connections (start the postmaster with the -i option).\n")); - printf (_("\n\ -Typically, the nagios user (unless the --logname option is used) should be\n\ -able to connect to the database without a password. The plugin can also send\n\ -a password, but no effort is made to obsure or encrypt the password.\n")); + printf ("\n"); + printf (" %s\n", _("All parameters are optional.")); + printf (" %s\n", _("This plugin tests a PostgreSQL DBMS to determine whether it is active and")); + printf (" %s\n", _("accepting queries. In its current operation, it simply connects to the")); + printf (" %s\n", _("specified database, and then disconnects. If no database is specified, it")); + printf (" %s\n", _("connects to the template1 database, which is present in every functioning")); + printf (" %s\n\n", _("PostgreSQL DBMS.")); + printf (" %s\n", _("The plugin will connect to a local postmaster if no host is specified. To")); + printf (" %s\n", _("connect to a remote host, be sure that the remote postmaster accepts TCP/IP")); + printf (" %s\n\n", _("connections (start the postmaster with the -i option).")); + printf (" %s\n", _("Typically, the nagios user (unless the --logname option is used) should be")); + 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.")); printf (_(UT_SUPPORT)); } @@ -439,7 +439,7 @@ a password, but no effort is made to obsure or encrypt the password.\n")); void print_usage (void) { - printf ("\ -Usage: %s [-H ] [-P ] [-c ] [-w ]\n\ - [-t ] [-d ] [-l ] [-p ]\n", progname); + printf (_("Usage:")); + printf ("%s [-H ] [-P ] [-c ] [-w ]\n", progname); + printf (" [-t ] [-d ] [-l ] [-p ]\n"); } diff --git a/plugins/check_ping.c b/plugins/check_ping.c index a7b7d90..4168f35 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -20,7 +20,7 @@ const char *progname = "check_ping"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -518,7 +518,9 @@ print_help (void) printf ("Copyright (c) 1999 Ethan Galstad "); printf (COPYRIGHT, copyright, email); - printf (_("Use ping to check connection statistics for a remote host.\n\n")); + printf (_("Use ping to check connection statistics for a remote host.")); + + printf ("\n\n"); print_usage (); @@ -526,31 +528,32 @@ print_help (void) printf (_(UT_IPv46)); - printf (_("\ --H, --hostname=HOST\n\ - host to ping\n\ --w, --warning=THRESHOLD\n\ - warning threshold pair\n\ --c, --critical=THRESHOLD\n\ - critical threshold pair\n\ --p, --packets=INTEGER\n\ - number of ICMP ECHO packets to send (Default: %d)\n\ --L, --link\n\ - show HTML in the plugin output (obsoleted by urlize)\n"), - DEFAULT_MAX_PACKETS); + printf (" %s\n", "-H, --hostname=HOST"); + printf (" %s\n", _("host to ping")); + printf (" %s\n", "-w, --warning=THRESHOLD"); + printf (" %s\n", _("warning threshold pair")); + printf (" %s\n", "-c, --critical=THRESHOLD"); + printf (" %s\n", _("critical threshold pair")); + printf (" %s\n", "-p, --packets=INTEGER"); + printf (" %s\n", _("number of ICMP ECHO packets to send")); + printf (_("(Default: %d)"), DEFAULT_MAX_PACKETS); + printf (" %s\n", "-L, --link"); + printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)")); printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); - printf (_("\ -THRESHOLD is ,%% where is the round trip average travel\n\ -time (ms) which triggers a WARNING or CRITICAL state, and is the\n\ -percentage of packet loss to trigger an alarm state.\n\n")); + printf ("%s\n", _("THRESHOLD is ,%% where is the round trip average travel")); + printf ("%s\n", _("time (ms) which triggers a WARNING or CRITICAL state, and is the")); + printf ("%s\n", _("percentage of packet loss to trigger an alarm state.")); + + printf ("\n\n"); + + printf ("%s\n", _("This plugin uses the ping command to probe the specified host for packet loss")); + printf ("%s\n", _("(percentage) and round trip average (milliseconds). It can produce HTML output")); + 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/")); - printf (_("\ -This plugin uses the ping command to probe the specified host for packet loss\n\ -(percentage) and round trip average (milliseconds). It can produce HTML output\n\ -linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in\n\ -the contrib area of the downloads section at http://www.nagios.org\n\n")); + printf ("\n\n"); printf (_(UT_SUPPORT)); } @@ -558,6 +561,7 @@ the contrib area of the downloads section at http://www.nagios.org\n\n")); void print_usage (void) { - printf ("Usage: %s -H -w ,%% -c ,%%\n\ - [-p packets] [-t timeout] [-L] [-4|-6]\n", progname); + printf (_("Usage:")); + printf ("%s -H -w ,%% -c ,%%\n", progname); + printf (" [-p packets] [-t timeout] [-L] [-4|-6]\n"); } diff --git a/plugins/check_procs.c b/plugins/check_procs.c index d05020b..030ef02 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c @@ -20,7 +20,7 @@ const char *progname = "check_procs"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -739,8 +739,8 @@ Examples:\n\ void print_usage (void) { - printf ("\ -Usage: %s -w -c [-m metric] [-s state] [-p ppid]\n\ - [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\ - [-C command] [-t timeout] [-v]\n", progname); + printf (_("Usage:")); + printf ("%s -w -c [-m metric] [-s state] [-p ppid]\n", progname); + printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n"); + printf (" [-C command] [-t timeout] [-v]\n"); } -- cgit v0.10-9-g596f