[Nagiosplug-checkins] nagiosplug/plugins check_dig.c,1.35,1.36 check_disk.c,1.53,1.54 check_dns.c,1.38,1.39 check_dummy.c,1.12,1.13 check_fping.c,1.21,1.22 check_game.c,1.18,1.19 check_hpjd.c,1.27,1.28 check_http.c,1.73,1.74 check_ide-smart.c,1.11,1.12 check_ldap.c,1.25,1.26 check_mrtg.c,1.20,1.21 check_mrtgtraf.c,1.21,1.22 check_nagios.c,1.20,1.21 check_nt.c,1.32,1.33 check_nwstat.c,1.24,1.25 check_overcr.c,1.15,1.16 check_pgsql.c,1.27,1.28 check_procs.c,1.38,1.39 check_radius.c,1.18,1.19 check_real.c,1.21,1.22 check_smtp.c,1.35,1.36 check_snmp.c,1.46,1.47 check_swap.c,1.38,1.39 check_tcp.c,1.53,1.54 check_time.c,1.21,1.22 check_udp.c,1.21,1.22 check_ups.c,1.23,1.24

Benoit Mortier opensides at users.sourceforge.net
Fri Dec 3 15:03:05 CET 2004


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

Modified Files:
	check_dig.c check_disk.c check_dns.c check_dummy.c 
	check_fping.c check_game.c check_hpjd.c check_http.c 
	check_ide-smart.c check_ldap.c check_mrtg.c check_mrtgtraf.c 
	check_nagios.c check_nt.c check_nwstat.c check_overcr.c 
	check_pgsql.c check_procs.c check_radius.c check_real.c 
	check_smtp.c check_snmp.c check_swap.c check_tcp.c 
	check_time.c check_udp.c check_ups.c 
Log Message:

print_help and print_usage() cleanup

other misc cleanups



Index: check_mrtg.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtg.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- check_mrtg.c	3 Dec 2004 20:28:52 -0000	1.20
+++ check_mrtg.c	3 Dec 2004 23:02:02 -0000	1.21
@@ -316,7 +316,7 @@
 
 	printf(_("\
 This plugin will check either the average or maximum value of one of the\n\
-two variables recorded in an MRTG log file.\n"));
+two variables recorded in an MRTG log file.\n\n"));
 
 	print_usage ();
 
@@ -377,5 +377,6 @@
 {
 	printf ("\
 Usage: %s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n\
-         [-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]\n", progname);
+                  [-l label] [-u units] [-e expire_minutes] [-t timeout]\n\
+									[-v]\n", progname);
 }

Index: check_dummy.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dummy.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- check_dummy.c	3 Dec 2004 20:28:52 -0000	1.12
+++ check_dummy.c	3 Dec 2004 23:02:02 -0000	1.13
@@ -91,14 +91,14 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\n");
 	printf (COPYRIGHT, copyright, email);
 
+	printf (_("\
+This plugin will simply return the state corresponding to the numeric value\n\
+of the <state> argument with optional text.\n\n"));
+
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
 
-	printf (_("\n\
-This plugin will simply return the state corresponding to the numeric value\n\
-of the <state> argument with optional text.\n"));
-
 	printf (_(UT_SUPPORT));
 }
 

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- check_tcp.c	3 Dec 2004 21:56:44 -0000	1.53
+++ check_tcp.c	3 Dec 2004 23:02:04 -0000	1.54
@@ -739,8 +739,8 @@
 {
 	print_revision (progname, revision);
 
-	printf (_("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\n"));
-	printf (_(COPYRIGHT), copyright, email);
+	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\n"));
+	printf (COPYRIGHT, copyright, email);
 
 	printf (_("This plugin tests %s connections with the specified host.\n\n"),
 	        SERVICE);
@@ -795,8 +795,8 @@
 {
 	printf ("\
 Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
-          [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
-          [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
-          [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\
-          [-S <use SSL>]\n", progname);
+                  [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
+                  [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
+                  [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\
+                  [-S <use SSL>]\n", progname);
 }

Index: check_overcr.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_overcr.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- check_overcr.c	3 Dec 2004 20:28:52 -0000	1.15
+++ check_overcr.c	3 Dec 2004 23:02:03 -0000	1.16
@@ -465,5 +465,5 @@
 {
 	printf ("\
 Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
-          [-t timeout]\n", progname);
+                  [-t timeout]\n", progname);
 }

Index: check_radius.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_radius.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- check_radius.c	3 Dec 2004 20:28:52 -0000	1.18
+++ check_radius.c	3 Dec 2004 23:02:03 -0000	1.19
@@ -26,6 +26,7 @@
 #include "common.h"
 #include "utils.h"
 #include "netutils.h"
+
 #include <radiusclient.h>
 
 int process_arguments (int, char **);
@@ -335,5 +336,5 @@
 {
 	printf ("\
 Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\
-          [-t timeout] [-r retries] [-e expect]\n", progname);
+                  [-t timeout] [-r retries] [-e expect]\n", progname);
 }

Index: check_mrtgtraf.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtgtraf.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_mrtgtraf.c	3 Dec 2004 20:28:52 -0000	1.21
+++ check_mrtgtraf.c	3 Dec 2004 23:02:02 -0000	1.22
@@ -321,6 +321,14 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\n");
 	printf (COPYRIGHT, copyright, email);
 
+	printf (_("\n\
+This plugin will check the incoming/outgoing transfer rates of a router,\n\
+switch, etc recorded in an MRTG log.  If the newest log entry is older\n\
+than <expire_minutes>, a WARNING status is returned. If either the\n\
+incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\
+Bytes/sec), a CRITICAL status results.  If either of the rates exceed\n\
+the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
+
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
@@ -337,14 +345,6 @@
  -c, --critical\n\
    Critical threshold pair \"<incoming>,<outgoing>\"\n"));
 
-	printf (_("\n\
-This plugin will check the incoming/outgoing transfer rates of a router,\n\
-switch, etc recorded in an MRTG log.  If the newest log entry is older\n\
-than <expire_minutes>, a WARNING status is returned. If either the\n\
-incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\
-Bytes/sec), a CRITICAL status results.  If either of the rates exceed\n\
-the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
-
 	printf (_("Notes:\n\
 - MRTG stands for Multi Router Traffic Grapher. It can be downloaded from\n\
   http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html\n\
@@ -363,6 +363,6 @@
 print_usage (void)
 {
 	printf ("\
-Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair>\n\
-          [-e expire_minutes] [-t timeout] [-v]\n", progname);
+Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair>\n\
+                      -c <critical_pair> [-e expire_minutes] [-t timeout] [-v]\n", progname);
 }

Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- check_http.c	3 Dec 2004 20:28:52 -0000	1.73
+++ check_http.c	3 Dec 2004 23:02:02 -0000	1.74
@@ -21,7 +21,7 @@
 
 const char *progname = "check_http";
 const char *revision = "$Revision$";
-const char *copyright = "1999-2001";
+const char *copyright = "1999-2004";
 const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
 #include "common.h"
@@ -1376,7 +1376,7 @@
 This plugin tests the HTTP service on the specified host. It can test\n\
 normal (http) and secure (https) servers, follow redirects, search for\n\
 strings and regular expressions, check connection times, and report on\n\
-certificate expiration times.\n"));
+certificate expiration times.\n\n"));
 
 	print_usage ();
 
@@ -1492,9 +1492,9 @@
 {
 	printf (_("\
 Usage: %s -H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\
-          [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
-          [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
-          [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
-          [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>] [-A string]\n\
-          [-k string]\n"), progname);
+                  [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
+                  [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
+                  [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
+                  [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>]\n\
+									[-A string] [-k string]\n"), progname);
 }

Index: check_time.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_time.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_time.c	3 Dec 2004 20:28:53 -0000	1.21
+++ check_time.c	3 Dec 2004 23:02:04 -0000	1.22
@@ -326,8 +326,7 @@
 	printf ("Copyright (c) 1999 Ethan Galstad\n");
 	printf (COPYRIGHT, copyright, email);
 
-	printf (_("\
-This plugin will check the time on the specified host.\n\n"));
+	printf (_("This plugin will check the time on the specified host.\n\n"));
 
 	print_usage ();
 
@@ -359,5 +358,5 @@
 {
 	printf ("\
 Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\
-          [-W connect_time] [-C connect_time] [-t timeout]\n", progname);
+                  [-W connect_time] [-C connect_time] [-t timeout]\n", progname);
 }

Index: check_udp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_udp.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_udp.c	3 Dec 2004 20:28:53 -0000	1.21
+++ check_udp.c	3 Dec 2004 23:02:04 -0000	1.22
@@ -264,5 +264,5 @@
 {
 	printf ("\
 Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\
-          [-e expect] [-s send] [-t to_sec] [-v]\n", progname);
+                  [-e expect] [-s send] [-t to_sec] [-v]\n", progname);
 }

Index: check_fping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_fping.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_fping.c	3 Dec 2004 20:28:52 -0000	1.21
+++ check_fping.c	3 Dec 2004 23:02:02 -0000	1.22
@@ -356,15 +356,15 @@
 print_help (void)
 {
 
-	print_revision (progname, "$Revision$");
+	print_revision (progname, revision);
 
 	printf ("Copyright (c) 1999 Didi Rieder <adrieder at sbox.tu-graz.ac.at>\n");
 	printf (COPYRIGHT, copyright, email);
 
 	printf (_("\
-This plugin will use the /bin/fping command (from saint) to ping the\n\
-specified host for a fast check if the host is alive. Note that it is\n\
-necessary to set the suid flag on fping.\n\n"));
+This plugin will use the /bin/fping command to ping the specified host\n\
+for a fast check if the host is alive.\n\
+Note that it is necessary to set the suid flag on fping.\n\n"));
 
 	print_usage ();
 

Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- check_dns.c	3 Dec 2004 20:28:52 -0000	1.38
+++ check_dns.c	3 Dec 2004 23:02:02 -0000	1.39
@@ -395,6 +395,12 @@
 	printf ("Copyright (c) 1999 Ethan Galstad <nagios at nagios.org>\n");
 	printf (COPYRIGHT, copyright, email);
 
+	printf (_("\
+This plugin uses the nslookup program to obtain the IP address\n\
+for the given host/domain query.  A optional DNS server to use may\n\
+be specified.  If no DNS server is specified, the default server(s)\n\
+specified in /etc/resolv.conf will be used.\n\n"));
+
 	print_usage ();
 
 	printf (_(UT_HELP_VRSN));
@@ -411,12 +417,6 @@
 
 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
 
-	printf (_("\n\
-This plugin uses the nslookup program to obtain the IP address\n\
-for the given host/domain query.  A optional DNS server to use may\n\
-be specified.  If no DNS server is specified, the default server(s)\n\
-specified in /etc/resolv.conf will be used.\n"));
-
 	printf (_(UT_SUPPORT));
 }
 

Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- check_swap.c	3 Dec 2004 20:28:53 -0000	1.38
+++ check_swap.c	3 Dec 2004 23:02:04 -0000	1.39
@@ -479,7 +479,7 @@
 
 	printf (_(COPYRIGHT), copyright, email);
 
-	printf (_("Check swap space on local server.\n\n"));
+	printf (_("Check swap space on local machine.\n\n"));
 
 	print_usage ();
 
@@ -514,7 +514,7 @@
 void
 print_usage (void)
 {
-	printf ("Usage:\n\
- %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
- %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname);
+	printf ("\
+	Usage: %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
+         %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname);
 }

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- check_pgsql.c	3 Dec 2004 20:28:52 -0000	1.27
+++ check_pgsql.c	3 Dec 2004 23:02:03 -0000	1.28
@@ -391,7 +391,7 @@
 
 	print_revision (progname, revision);
 
-	printf (_(COPYRIGHT), copyright, email);
+	printf (COPYRIGHT, copyright, email);
 
 	printf (_("Test whether a PostgreSQL Database is accepting connections.\n\n"));
 
@@ -443,5 +443,5 @@
 {
 	printf ("\
 Usage: %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\
-          [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname);
+                  [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname);
 }

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- check_snmp.c	3 Dec 2004 20:28:52 -0000	1.46
+++ check_snmp.c	3 Dec 2004 23:02:03 -0000	1.47
@@ -842,7 +842,7 @@
 {
 	print_revision (progname, revision);
 
-	printf (_(COPYRIGHT), copyright, email);
+	printf (COPYRIGHT, copyright, email);
 
 	printf (_("\
 Check status of remote machines and obtain sustem information via SNMP\n\n"));
@@ -950,9 +950,9 @@
 {
 	printf ("\
 Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
-          [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
-          [-l label] [-u units] [-p port-number] [-d delimiter]\n\
-          [-D output-delimiter] [-m miblist] [-P snmp version]\n\
-          [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
-          [-X privpasswd]\n", progname);
+                  [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
+                  [-l label] [-u units] [-p port-number] [-d delimiter]\n\
+                  [-D output-delimiter] [-m miblist] [-P snmp version]\n\
+                  [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
+                  [-X privpasswd]\n", progname);
 }

Index: check_ide-smart.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ide-smart.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- check_ide-smart.c	3 Dec 2004 20:28:52 -0000	1.11
+++ check_ide-smart.c	3 Dec 2004 23:02:02 -0000	1.12
@@ -146,6 +146,125 @@
 	};
 
 
+int
+main (int argc, char *argv[]) 
+{
+	char *device = NULL;
+	int command = -1;
+	int o, longindex;
+	int retval = 0;
+
+	thresholds_t thresholds;
+	values_t values;
+	int fd;
+
+	static struct option longopts[] = { 
+		{"device", required_argument, 0, 'd'}, 
+		{"immediate", no_argument, 0, 'i'}, 
+		{"quiet-check", no_argument, 0, 'q'}, 
+		{"auto-on", no_argument, 0, '1'}, 
+		{"auto-off", no_argument, 0, '0'}, 
+		{"net-saint", no_argument, 0, 'n'}, 
+		{"help", no_argument, 0, 'h'}, 
+		{"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 
+	};
+
+	setlocale (LC_ALL, "");
+	bindtextdomain (PACKAGE, LOCALEDIR);
+	textdomain (PACKAGE);
+
+	while (1) {
+		
+		o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
+		
+		if (o == -1 || o == EOF)
+			break;
+
+		switch (o) {
+		case 'd':
+			device = optarg;
+			break;
+		case 'q':
+			command = 3;
+			break;
+		case 'i':
+			command = 2;
+			break;
+		case '1':
+			command = 1;
+			break;
+		case '0':
+			command = 0;
+			break;
+		case 'n':
+			command = 4;
+			break;
+		case 'h':
+			print_help ();
+			return STATE_OK;
+		case 'V':
+			print_revision (progname, revision);
+			return STATE_OK;
+		default:
+			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+			print_usage ();
+			exit (STATE_UNKNOWN);
+		}
+
+		if (optind < argc) {
+			device = argv[optind];
+		}
+
+		if (!device) {
+			show_help ();
+			show_version ();
+			return -1;
+		}
+
+		fd = open (device, O_RDONLY);
+
+		if (fd < 0) {
+			printf (_("CRITICAL - Couldn't open device: %s\n"), strerror (errno));
+			return 2;
+		}
+
+		if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, TRUE)) {
+			printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
+			return 2;
+		}
+
+		switch (command) {
+		case 0:
+			retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0, TRUE);
+			break;
+		case 1:
+			retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0xF8, TRUE);
+			break;
+		case 2:
+			retval = smart_cmd_simple (fd, SMART_CMD_IMMEDIATE_OFFLINE, 0, TRUE);
+			break;
+		case 3:
+			smart_read_values (fd, &values);
+			smart_read_thresholds (fd, &thresholds);
+			retval = values_not_passed (&values, &thresholds);
+			break;
+		case 4:
+			smart_read_values (fd, &values);
+			smart_read_thresholds (fd, &thresholds);
+			retval = net_saint (&values, &thresholds);
+			break;
+		default:
+			smart_read_values (fd, &values);
+			smart_read_thresholds (fd, &thresholds);
+			print_values (&values, &thresholds);
+			break;
+		}
+		close (fd);
+	}
+	return retval;
+}
+
+
 
 char *
 get_offline_text (int status) 
@@ -371,19 +490,14 @@
 
 
 void
-show_version () 
+print_help () 
 {
-	printf ("check_ide-smart v.1 - FREE Software with NO WARRANTY\n");
-	printf ("Nagios feature - Robert Dale <rdale at digital-mission.com>\n");
+	print_revision (progname, revision);
+
+	printf ("Nagios feature - 1999 Robert Dale <rdale at digital-mission.com>\n");
 	printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar at lightside.dhis.org>\n");
 	printf (COPYRIGHT, copyright, email);
-}
-
-
-
-void
-show_help () 
-{
+	
 	printf (_("\
 Usage: %s [DEVICE] [OPTION]\n\
  -d, --device=DEVICE\n\
@@ -402,120 +516,8 @@
 
 
 
-int
-main (int argc, char *argv[]) 
+void
+print_usage (void)
 {
-	char *device = NULL;
-	int command = -1;
-	int o, longindex;
-	int retval = 0;
-
-	thresholds_t thresholds;
-	values_t values;
-	int fd;
-
-	static struct option longopts[] = { 
-		{"device", required_argument, 0, 'd'}, 
-		{"immediate", no_argument, 0, 'i'}, 
-		{"quiet-check", no_argument, 0, 'q'}, 
-		{"auto-on", no_argument, 0, '1'}, 
-		{"auto-off", no_argument, 0, '0'}, 
-		{"net-saint", no_argument, 0, 'n'}, 
-		{"help", no_argument, 0, 'h'}, 
-		{"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 
-	};
-
-	setlocale (LC_ALL, "");
-	bindtextdomain (PACKAGE, LOCALEDIR);
-	textdomain (PACKAGE);
-
-	while (1) {
-		
-		o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
-		
-		if (o == -1 || o == EOF)
-			break;
-
-		switch (o) {
-		case 'd':
-			device = optarg;
-			break;
-		case 'q':
-			command = 3;
-			break;
-		case 'i':
-			command = 2;
-			break;
-		case '1':
-			command = 1;
-			break;
-		case '0':
-			command = 0;
-			break;
-		case 'n':
-			command = 4;
-			break;
-		case 'h':
-			show_help ();
-			return 0;
-		case 'V':
-			show_version ();
-			return 0;
-		default:
-			printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-			print_usage ();
-			exit (STATE_UNKNOWN);
-		}
-
-		if (optind < argc) {
-			device = argv[optind];
-		}
-
-		if (!device) {
-			show_help ();
-			show_version ();
-			return -1;
-		}
-
-		fd = open (device, O_RDONLY);
-
-		if (fd < 0) {
-			printf (_("CRITICAL - Couldn't open device: %s\n"), strerror (errno));
-			return 2;
-		}
-
-		if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, TRUE)) {
-			printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
-			return 2;
-		}
-
-		switch (command) {
-		case 0:
-			retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0, TRUE);
-			break;
-		case 1:
-			retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0xF8, TRUE);
-			break;
-		case 2:
-			retval = smart_cmd_simple (fd, SMART_CMD_IMMEDIATE_OFFLINE, 0, TRUE);
-			break;
-		case 3:
-			smart_read_values (fd, &values);
-			smart_read_thresholds (fd, &thresholds);
-			retval = values_not_passed (&values, &thresholds);
-			break;
-		case 4:
-			smart_read_values (fd, &values);
-			smart_read_thresholds (fd, &thresholds);
-			retval = net_saint (&values, &thresholds);
-			break;
-		default:
-			smart_read_values (fd, &values);
-			smart_read_thresholds (fd, &thresholds);
-			print_values (&values, &thresholds);
-			break;
-		}
-		close (fd);
-	}
-	return retval;
+	printf ("Usage: %s \n"), progname);
 }

Index: check_real.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_real.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_real.c	3 Dec 2004 20:28:52 -0000	1.21
+++ check_real.c	3 Dec 2004 23:02:03 -0000	1.22
@@ -438,5 +438,5 @@
 {
 	printf ("\
 Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\
-          [-t timeout] [-v]\n", progname);
+                  [-t timeout] [-v]\n", progname);
 }

Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- check_disk.c	3 Dec 2004 20:28:52 -0000	1.53
+++ check_disk.c	3 Dec 2004 23:01:46 -0000	1.54
@@ -21,7 +21,7 @@
 const char *progname = "check_disk";
 const char *program_name = "check_disk";	// Required for coreutils libs
 const char *revision = "$Revision$";
-const char *copyright = "1999-2003";
+const char *copyright = "1999-2004";
 const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
 #include "common.h"
@@ -578,7 +578,7 @@
 
 	printf (_("\
 This plugin checks the amount of used disk space on a mounted file system\n\
-and generates an alert if free space is less than one of the threshold values."));
+and generates an alert if free space is less than one of the threshold values.\n\n"));
 
 	print_usage ();
 
@@ -638,5 +638,5 @@
 {
 	printf ("\
 Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
-          [-v] [-q]\n", progname);
+                  [-v] [-q]\n", progname);
 }

Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- check_dig.c	3 Dec 2004 20:28:52 -0000	1.35
+++ check_dig.c	3 Dec 2004 23:01:46 -0000	1.36
@@ -20,7 +20,7 @@
 
 const char *progname = "check_dig";
 const char *revision = "$Revision$";
-const char *copyright = "2002-2003";
+const char *copyright = "2002-2004";
 const char *email = "nagiosplug-devel at lists.sourceforge.net";
 
 #include "common.h"
@@ -221,7 +221,7 @@
 			print_help ();
 			exit (STATE_OK);
 		case 'V':									/* version */
-			print_revision (progname, "$Revision$");
+			print_revision (progname, revision);
 			exit (STATE_OK);
 		case 'H':									/* hostname */
 			if (is_host (optarg)) {
@@ -318,7 +318,7 @@
 	printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop at users.sourceforge.net>\n");
 	printf (COPYRIGHT, copyright, email);
 
-	printf (_("Test the DNS service on the specified host using dig\n"));
+	printf (_("Test the DNS service on the specified host using dig\n\n"));
 
 	print_usage ();
 

Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check_ups.c	3 Dec 2004 20:28:53 -0000	1.23
+++ check_ups.c	3 Dec 2004 23:02:04 -0000	1.24
@@ -592,7 +592,6 @@
 	printf ("Copyright (c) 2000 Tom Shields");
 	printf ("Copyright (c) 2004 Alain Richard <alain.richard at equation.fr>\n");
 	printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette at mgeups.com>\n");
-
 	printf (COPYRIGHT, copyright, email);
 
 	printf (_("This plugin tests the UPS service on the specified host.\n\
@@ -648,5 +647,5 @@
 {
 	printf ("\
 Usage: %s -H host -u ups [-p port] [-v variable]\n\
-          [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname);
+                  [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname);
 }

Index: check_nwstat.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nwstat.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- check_nwstat.c	3 Dec 2004 20:28:52 -0000	1.24
+++ check_nwstat.c	3 Dec 2004 23:02:02 -0000	1.25
@@ -908,8 +908,8 @@
 	printf (COPYRIGHT, copyright, email);
 
 	printf (_("\
-Usage: %s This plugin attempts to contact the MRTGEXT NLM running\n\
-on a Novell server to gather the requested system information.\n\n"),
+This plugin attempts to contact the MRTGEXT NLM running on a\n\
+Novell server to gather the requested system information.\n\n"),
 	        progname);
 
 	print_usage();
@@ -989,5 +989,5 @@
 {
 	printf ("\
 Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
-          [-t timeout].\n", progname);
+                  [-t timeout].\n", progname);
 }

Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- check_hpjd.c	3 Dec 2004 20:28:52 -0000	1.27
+++ check_hpjd.c	3 Dec 2004 23:02:02 -0000	1.28
@@ -398,6 +398,5 @@
 void
 print_usage (void)
 {
-	printf (_("\
-Usage: %s -H host [-C community]\n"), progname);
+	printf ("Usage: %s -H host [-C community]\n"), progname);
 }

Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- check_smtp.c	3 Dec 2004 20:28:52 -0000	1.35
+++ check_smtp.c	3 Dec 2004 23:02:03 -0000	1.36
@@ -422,8 +422,7 @@
 	printf ("Copyright (c) 1999-2001 Ethan Galstad <nagios at nagios.org>\n");
 	printf (COPYRIGHT, copyright, email);
 
-	printf(_("\
-This plugin will attempt to open an SMTP connection with the host.\n\n"));
+	printf(_("This plugin will attempt to open an SMTP connection with the host.\n\n"));
 
 	print_usage ();
 
@@ -468,5 +467,5 @@
 {
 	printf ("\
 Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\
-          [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
+                  [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
 }

Index: check_game.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_game.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- check_game.c	3 Dec 2004 20:28:52 -0000	1.18
+++ check_game.c	3 Dec 2004 23:02:02 -0000	1.19
@@ -302,7 +302,7 @@
 	printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n");
 	printf (_(COPYRIGHT), copyright, email);
 
-	printf (_("This plugin tests %s connections with the specified host."), progname);
+	printf (_("This plugin tests game server connections with the specified host."), progname);
 
 	print_usage ();
 
@@ -334,7 +334,7 @@
 {
 	printf ("\
 Usage: %s <game> <ip_address> [-p port] [-gf game_field] [-mf map_field]\n\
-          [-pf ping_field]\n", progname);
+                  [-pf ping_field]\n", progname);
 }
 
 /******************************************************************************

Index: check_nagios.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nagios.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- check_nagios.c	3 Dec 2004 20:28:52 -0000	1.20
+++ check_nagios.c	3 Dec 2004 23:02:02 -0000	1.21
@@ -276,7 +276,7 @@
 machine. The plugin will check to make sure the Nagios status log is no older\n\
 than the number of minutes specified by the <expire_minutes> option.  It also\n\
 uses the /bin/ps command to check for a process matching whatever you specify\n\
-by the <process_string> argument.\n"));
+by the <process_string> argument.\n\n"));
 
 	print_usage ();
 

Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- check_procs.c	3 Dec 2004 20:28:52 -0000	1.38
+++ check_procs.c	3 Dec 2004 23:02:03 -0000	1.39
@@ -751,6 +751,6 @@
 {
 	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);
+                  [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\
+                  [-C command] [-t timeout] [-v]\n", progname);
 }

Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- check_ldap.c	3 Dec 2004 20:28:52 -0000	1.25
+++ check_ldap.c	3 Dec 2004 23:02:02 -0000	1.26
@@ -277,8 +277,6 @@
 
 
 
-
-
 void
 print_help (void)
 {
@@ -334,7 +332,8 @@
 {
 	printf ("\
 Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\
-         [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n",
+                  [-P <password>] [-w <warn_time>] [-c <crit_time>]\n\
+									[-t timeout]%s\n",
 //(Note: all times are in seconds.)\n",
 	        progname,
 #ifdef HAVE_LDAP_SET_OPTION

Index: check_nt.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nt.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- check_nt.c	3 Dec 2004 20:28:52 -0000	1.32
+++ check_nt.c	3 Dec 2004 23:02:02 -0000	1.33
@@ -608,11 +608,15 @@
 void print_help(void)
 {
 	print_revision(progname,revision);
-	printf (_("\
-Copyright (c) 2000 Yves Rubin (rubiyz at yahoo.com)\n\n\
-This plugin collects data from the NSClient service running on a\n\
-Windows NT/2000/XP server.\n\n"));
+	
+	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"));
+
 	print_usage();
+	
   printf (_("\nOptions:\n\
 -H, --hostname=HOST\n\
   Name of the host to check\n\
@@ -629,8 +633,8 @@
 -h, --help\n\
   Print this help screen\n\
 -V, --version\n\
-  Print version information\n"),
-	        PORT, DEFAULT_SOCKET_TIMEOUT);
+  Print version information\n"), PORT, DEFAULT_SOCKET_TIMEOUT);
+	
   printf (_("\
 -v, --variable=STRING\n\
   Variable to check.  Valid variables are:\n"));
@@ -684,5 +688,5 @@
 {
 	printf("\
 Usage: %s -H host -v variable [-p port] [-w warning] [-c critical]\n\
-          [-l params] [-d SHOWALL] [-t timeout]\n", progname);
+                  [-l params] [-d SHOWALL] [-t timeout]\n", progname);
 }





More information about the Commits mailing list