[Nagiosplug-checkins] nagiosplug/plugins check_hpjd.c, 1.32, 1.33 check_nt.c, 1.39, 1.40 check_ntp.c, 1.7, 1.8 check_nwstat.c, 1.31, 1.32 check_overcr.c, 1.19, 1.20 check_pgsql.c, 1.32, 1.33 check_ping.c, 1.50, 1.51 check_procs.c, 1.49, 1.50

Benoit Mortier opensides at users.sourceforge.net
Sat Jun 17 14:28:45 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7365/plugins

Modified Files:
	check_hpjd.c check_nt.c check_ntp.c check_nwstat.c 
	check_overcr.c check_pgsql.c check_ping.c check_procs.c 
Log Message:

cleaning up help and usage



Index: check_ntp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ntp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- check_ntp.c	1 May 2006 21:52:42 -0000	1.7
+++ check_ntp.c	17 Jun 2006 12:28:43 -0000	1.8
@@ -768,23 +768,29 @@
 }
 
 
-void print_usage(void){
-	printf("\
-Usage: %s -H <host> [-O] [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-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 <host> [-O] [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n", progname);
 }

Index: check_overcr.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_overcr.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- check_overcr.c	25 Dec 2004 23:17:44 -0000	1.19
+++ check_overcr.c	17 Jun 2006 12:28:43 -0000	1.20
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -403,9 +403,10 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\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 @@
 
 	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<filesys>  = percent used disk space on filesystem <filesys>\n\
-     PROC<process> = number of running processes with name <process>\n\
-     NET<port>     = number of active connections on TCP port <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<filesys>  = percent used disk space on filesystem <filesys>"));
+  printf ("    %s\n", _("PROC<process> = number of running processes with name <process>"));
+  printf ("    %s\n", _("NET<port>     = number of active connections on TCP port <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 @@
 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);
 }

Index: check_nwstat.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nwstat.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- check_nwstat.c	21 Sep 2005 13:04:54 -0000	1.31
+++ check_nwstat.c	17 Jun 2006 12:28:43 -0000	1.32
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -1013,9 +1013,10 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\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 @@
 
 	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 @@
 
 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);
 }

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- check_pgsql.c	6 Jun 2006 16:48:48 -0000	1.32
+++ check_pgsql.c	17 Jun 2006 12:28:43 -0000	1.33
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -391,7 +391,9 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 void
 print_usage (void)
 {
-	printf ("\
-Usage: %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\
-                  [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname);
+  printf (_("Usage:"));
+	printf ("%s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n", progname);
+  printf (" [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n");
 }

Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- check_procs.c	27 Apr 2006 13:25:09 -0000	1.49
+++ check_procs.c	17 Jun 2006 12:28:43 -0000	1.50
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -739,8 +739,8 @@
 void
 print_usage (void)
 {
-	printf ("\
-Usage: %s -w <range> -c <range> [-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 <range> -c <range> [-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");
 }

Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- check_ping.c	13 Mar 2006 11:08:28 -0000	1.50
+++ check_ping.c	17 Jun 2006 12:28:43 -0000	1.51
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -518,7 +518,9 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>");
 	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 @@
 
 	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 <rta>,<pl>%% where <rta> is the round trip average travel\n\
-time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the\n\
-percentage of packet loss to trigger an alarm state.\n\n"));
+	printf ("%s\n", _("THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel"));
+  printf ("%s\n", _("time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"));
+  printf ("%s\n", _("percentage of packet loss to trigger an alarm state."));
 
-	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 ("%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 ("\n\n");
 
 	printf (_(UT_SUPPORT));
 }
@@ -558,6 +561,7 @@
 void
 print_usage (void)
 {
-	printf ("Usage: %s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n\
-                     [-p packets] [-t timeout] [-L] [-4|-6]\n", progname);
+  printf (_("Usage:"));
+	printf ("%s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname);
+  printf (" [-p packets] [-t timeout] [-L] [-4|-6]\n");
 }

Index: check_nt.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nt.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- check_nt.c	19 Jan 2005 23:39:45 -0000	1.39
+++ check_nt.c	17 Jun 2006 12:28:43 -0000	1.40
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -614,11 +614,15 @@
 	printf ("Copyright (c) 2000 Yves Rubin (rubiyz at 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 @@
 
 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");
 }

Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- check_hpjd.c	27 Jun 2005 13:07:39 -0000	1.32
+++ check_hpjd.c	17 Jun 2006 12:28:43 -0000	1.33
@@ -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 at lists.sourceforge.net";
 
 #include "common.h"
@@ -374,17 +374,18 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\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 @@
 void
 print_usage (void)
 {
-	printf ("Usage: %s -H host [-C community]\n", progname);
+  printf (_("Usage:"));
+	printf ("%s -H host [-C community]\n", progname);
 }





More information about the Commits mailing list