[Nagiosplug-checkins] nagiosplug/plugins check_by_ssh.c,1.23,1.24 check_dig.c,1.28,1.29 check_disk.c,1.48,1.49 check_dns.c,1.30,1.31 check_dummy.c,1.8,1.9 check_fping.c,1.15,1.16 check_game.c,1.11,1.12 check_hpjd.c,1.21,1.22 check_http.c,1.66,1.67 check_ide-smart.c,1.5,1.6 check_ldap.c,1.17,1.18 check_load.c,1.16,1.17 check_mrtg.c,1.14,1.15 check_mrtgtraf.c,1.14,1.15 check_mysql.c,1.15,1.16 check_nagios.c,1.12,1.13 check_nt.c,1.25,1.26 check_nwstat.c,1.16,1.17 check_overcr.c,1.9,1.10 check_pgsql.c,1.18,1.19 check_ping.c,1.29,1.30 check_procs.c,1.29,1.30 check_radius.c,1.11,1.12 check_real.c,1.14,1.15 check_smtp.c,1.29,1.30 check_snmp.c,1.39,1.40 check_ssh.c,1.16,1.17 check_swap.c,1.32,1.33 check_tcp.c,1.44,1.45 check_time.c,1.14,1.15 check_udp.c,1.13,1.14 check_ups.c,1.15,1.16 check_users.c,1.11,1.12 common.h,1.13,1.14 getaddrinfo.c,1.1,1.2 getaddrinfo.h,1.1,1.2 gethostbyname.c,1.1,1.2 gethostbyname.h,1.1,1.2 negate.c,1.15,1.16 netutils.c,1.20,1.21 netutils.h,1.9,1.10 popen.c,1.7,1.8 urlize.c,1.12,1.13 utils.c,1.37,1.38 utils.h,1.19,1.20
Benoit Mortier
opensides at users.sourceforge.net
Wed Dec 1 15:56:01 CET 2004
- Previous message: [Nagiosplug-checkins] nagiosplug/doc RELEASING,NONE,1.1
- Next message: Removal of process_argument return code check (was Re: [Nagiosplug-checkins] nagiosplug/plugins check_by_ssh.c,1.23,1.24 check_dig.c,1.28,1.29 check_disk.c,1.48,1.49 check_dns.c,1.30,1.31 check_dummy.c,1.8,1.9 check_fping.c,1.15,1.16 check_game.c,1.11,1.12 check_hpjd.c,1.21,1.22 check_http.c,1.66,1.67 check_ide-smart.c,1.5,1.6 check_ldap.c,1.17,1.18 check_load.c,1.16,1.17 check_mrtg.c,1.14,1.15 check_mrtgtraf.c,1.14,1.15 check_mysql.c,1.15,1.16 check_nagios.c,1.12,1.13 check_nt.c,1.25,1.26 check_nwstat.c,1.16,1.17 check_overcr.c,1.9,1.10 check_pgsql.c,1.18,1.19 check_ping.c,1.29,1.30 check_procs.c,1.29,1.30 check_radius.c,1.11,1.12 check_real.c,1.14,1.15 check_smtp.c,1.29,1.30 check_snmp.c,1.39,1.40 check_ssh.c,1.16,1.17 check_swap.c,1.32,1.33 check_tcp.c,1.44,1.45 check_time.c,1.14,1.15 check_udp.c,1.13,1.14 check_ups.c,1.15,1.16 check_users.c,1.11,1.12 common.h,1.13,1.14 getaddrinfo.c,1.1,1.2 getaddrinfo.h,1.1,1.2 gethostbyname.c,1.1,1.2 gethostbyname.h,1.1,1.2 ne! gate.c! ,1.15,1.16 netutils.c,1.20,1.21 netutils.h,1.9,1.10 pop! en.c,1.7,1.8 urlize.c,1.12,1.13 utils.c,1.37,1.38 utils.h,1.19,1.20)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6736/plugins
Modified Files:
check_by_ssh.c 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_load.c
check_mrtg.c check_mrtgtraf.c check_mysql.c check_nagios.c
check_nt.c check_nwstat.c check_overcr.c check_pgsql.c
check_ping.c check_procs.c check_radius.c check_real.c
check_smtp.c check_snmp.c check_ssh.c check_swap.c check_tcp.c
check_time.c check_udp.c check_ups.c check_users.c common.h
getaddrinfo.c getaddrinfo.h gethostbyname.c gethostbyname.h
negate.c netutils.c netutils.h popen.c urlize.c utils.c
utils.h
Log Message:
standardize localization string
standardize unknow arguments
Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- check_tcp.c 1 Dec 2004 08:26:59 -0000 1.44
+++ check_tcp.c 1 Dec 2004 23:54:51 -0000 1.45
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
/* progname "check_tcp" changes depending on symlink called */
@@ -100,9 +102,6 @@
-
-
-
int
main (int argc, char **argv)
{
@@ -241,7 +240,7 @@
status = strdup ("");
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_tcp: could not parse arguments\n"));
/* use default expect if none listed in process_arguments() */
if (EXPECT && server_expect_count == 0) {
@@ -389,7 +388,6 @@
return result;
}
-
@@ -481,12 +479,12 @@
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
- usage2 (_("invalid host name or address"), optarg);
+ usage2 (_("invalid hostname/address"), optarg);
server_address = optarg;
break;
case 'c': /* critical */
if (!is_intnonneg (optarg))
- usage (_("Critical threshold must be a nonnegative integer\n"));
+ usage (_("Critical threshold must be a positive integer\n"));
else
critical_time = strtod (optarg, NULL);
check_critical_time = TRUE;
@@ -496,7 +494,7 @@
break;
case 'w': /* warning */
if (!is_intnonneg (optarg))
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
else
warning_time = strtod (optarg, NULL);
check_warning_time = TRUE;
@@ -517,7 +515,7 @@
break;
case 'p': /* port */
if (!is_intpos (optarg))
- usage (_("Server port must be a positive integer\n"));
+ usage (_("Port must be a positive integer\n"));
else
server_port = atoi (optarg);
break;
@@ -548,7 +546,7 @@
else if (!strncmp(optarg,"crit",4))
econn_refuse_state = STATE_CRITICAL;
else
- usage (_("Refuse mut be one of ok, warn, crit\n"));
+ usage (_("Refuse must be one of ok, warn, crit\n"));
break;
case 'd':
if (is_intpos (optarg))
@@ -578,7 +576,8 @@
return OK;
}
-
+
+
#ifdef HAVE_SSL
int
@@ -634,6 +633,8 @@
}
#endif
+
+
#ifdef HAVE_SSL
int
check_certificate (X509 ** certificate)
@@ -710,6 +711,8 @@
}
#endif
+
+
int
my_recv (void)
{
@@ -731,9 +734,6 @@
-
-
-
void
print_help (void)
{
@@ -790,7 +790,6 @@
-
void
print_usage (void)
{
Index: common.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/common.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- common.h 23 Aug 2004 21:18:12 -0000 1.13
+++ common.h 1 Dec 2004 23:54:51 -0000 1.14
@@ -28,6 +28,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+ * $Id$
+ *
*****************************************************************************/
#include "config.h"
Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- check_ldap.c 24 Nov 2004 00:46:39 -0000 1.17
+++ check_ldap.c 1 Dec 2004 23:54:51 -0000 1.18
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_ldap";
@@ -242,8 +244,9 @@
#endif
break;
default:
- usage (_("check_ldap: could not parse unknown arguments\n"));
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -274,7 +277,6 @@
-
void
print_help (void)
{
Index: check_mrtgtraf.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtgtraf.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- check_mrtgtraf.c 24 Nov 2004 00:46:39 -0000 1.14
+++ check_mrtgtraf.c 1 Dec 2004 23:54:51 -0000 1.15
@@ -13,6 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
******************************************************************************/
@@ -38,9 +40,6 @@
unsigned long outgoing_critical_threshold = 0L;
-
-
-
int
main (int argc, char **argv)
{
@@ -64,7 +63,7 @@
char outgoing_speed_rating[8];
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_ldap: could not parse arguments\n"));
/* open the MRTG log file for reading */
fp = fopen (log_file, "r");
@@ -259,7 +258,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -314,7 +315,6 @@
-
void
print_help (void)
{
Index: check_http.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- check_http.c 24 Nov 2004 04:25:52 -0000 1.66
+++ check_http.c 1 Dec 2004 23:54:51 -0000 1.67
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
/* splint -I. -I../../plugins -I../../lib/ -I/usr/kerberos/include/ ../../plugins/check_http.c */
@@ -188,7 +190,7 @@
#endif
return result;
}
-
+
/* process command-line arguments */
@@ -249,7 +251,9 @@
switch (c) {
case '?': /* usage */
- usage3 (_("unknown argument"), optopt);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
break;
case 'h': /* help */
print_help ();
@@ -267,7 +271,7 @@
break;
case 'c': /* critical time threshold */
if (!is_nonnegative (optarg))
- usage2 (_("invalid critical threshold"), optarg);
+ usage2 (_("Critical threshold must be integer"), optarg);
else {
critical_time = strtod (optarg, NULL);
check_critical_time = TRUE;
@@ -275,7 +279,7 @@
break;
case 'w': /* warning time threshold */
if (!is_nonnegative (optarg))
- usage2 (_("invalid warning threshold"), optarg);
+ usage2 (_("Warning threshold must be integer"), optarg);
else {
warning_time = strtod (optarg, NULL);
check_warning_time = TRUE;
@@ -304,13 +308,13 @@
case 'C': /* Check SSL cert validity */
#ifdef HAVE_SSL
if (!is_intnonneg (optarg))
- usage2 (_("invalid certificate expiration period"), optarg);
+ usage2 (_("Invalid certificate expiration period"), optarg);
else {
days_till_exp = atoi (optarg);
check_cert = TRUE;
}
#else
- usage (_("check_http: invalid option - SSL is not available\n"));
+ usage (_("Invalid option - SSL is not available\n"));
#endif
break;
case 'f': /* onredirect */
@@ -455,7 +459,7 @@
return TRUE;
}
-
+
/* written by lauri alanko */
@@ -498,8 +502,6 @@
buf[i] = '\0';
return buf;
}
-
-
@@ -613,6 +615,7 @@
}
+
static void
check_document_dates (const char *headers)
{
@@ -818,12 +821,12 @@
if ( sslerr == SSL_ERROR_SSL ) {
die (STATE_WARNING, _("Client Certificate Required\n"));
} else {
- die (STATE_CRITICAL, _("Error in recv()\n"));
+ die (STATE_CRITICAL, _("Error on receive\n"));
}
}
else {
#endif
- die (STATE_CRITICAL, _("Error in recv()\n"));
+ die (STATE_CRITICAL, _("Error on receive\n"));
#ifdef HAVE_SSL
}
#endif
@@ -950,7 +953,7 @@
microsec = deltime (tv);
elapsed_time = (double)microsec / 1.0e6;
asprintf (&msg,
- _("HTTP problem: %s - %.3f second response time %s%s|%s %s\n"),
+ _("HTTP WARNING: %s - %.3f second response time %s%s|%s %s\n"),
status_line, elapsed_time, timestamp,
(display_html ? "</A>" : ""),
perfd_time (elapsed_time), perfd_size (pagesize));
@@ -1021,7 +1024,6 @@
-
/* per RFC 2396 */
#define HDR_LOCATION "%*[Ll]%*[Oo]%*[Cc]%*[Aa]%*[Tt]%*[Ii]%*[Oo]%*[Nn]: "
#define URI_HTTP "%[HTPShtps]://"
@@ -1223,6 +1225,8 @@
}
#endif
+
+
#ifdef HAVE_SSL
int
check_certificate (X509 ** certificate)
@@ -1298,7 +1302,7 @@
return STATE_OK;
}
#endif
-
+
char *perfd_time (double elapsed_time)
@@ -1310,6 +1314,7 @@
}
+
char *perfd_size (int page_len)
{
return perfdata ("size", page_len, "B",
@@ -1319,6 +1324,7 @@
}
+
int
my_recv (void)
{
@@ -1337,6 +1343,7 @@
}
+
int
my_close (void)
{
@@ -1357,9 +1364,6 @@
-
-
-
void
print_help (void)
{
@@ -1483,7 +1487,6 @@
-
void
print_usage (void)
{
Index: check_time.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_time.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- check_time.c 24 Nov 2004 00:46:39 -0000 1.14
+++ check_time.c 1 Dec 2004 23:54:51 -0000 1.15
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
#include "common.h"
@@ -61,7 +63,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_time: could not parse arguments\n"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
@@ -168,9 +170,6 @@
-
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -217,7 +216,9 @@
switch (c) {
case '?': /* print short usage statement if args not parsable */
- usage3 (_("Unknown argument"), optopt);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'h': /* help */
print_help ();
exit (STATE_OK);
@@ -226,7 +227,7 @@
exit (STATE_OK);
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
- usage2 (_("Invalid host name/address"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
server_address = optarg;
break;
case 'w': /* warning-variance */
@@ -240,11 +241,11 @@
check_warning_time = TRUE;
}
else {
- usage (_("Warning thresholds must be a nonnegative integer\n"));
+ usage (_("Warning thresholds must be a positive integer\n"));
}
}
else {
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
}
break;
case 'c': /* critical-variance */
@@ -259,30 +260,30 @@
check_critical_time = TRUE;
}
else {
- usage (_("Critical thresholds must be a nonnegative integer\n"));
+ usage (_("Critical thresholds must be a positive integer\n"));
}
}
else {
- usage (_("Critical threshold must be a nonnegative integer\n"));
+ usage (_("Critical threshold must be a positive integer\n"));
}
break;
case 'W': /* warning-connect */
if (!is_intnonneg (optarg))
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
else
warning_time = atoi (optarg);
check_warning_time = TRUE;
break;
case 'C': /* critical-connect */
if (!is_intnonneg (optarg))
- usage (_("Critical threshold must be a nonnegative integer\n"));
+ usage (_("Critical threshold must be a positive integer\n"));
else
critical_time = atoi (optarg);
check_critical_time = TRUE;
break;
case 'p': /* port */
if (!is_intnonneg (optarg))
- usage (_("Server port must be a nonnegative integer\n"));
+ usage (_("Port must be a positive integer\n"));
else
server_port = atoi (optarg);
break;
@@ -301,11 +302,11 @@
if (server_address == NULL) {
if (argc > c) {
if (is_host (argv[c]) == FALSE)
- usage2 (_("Invalid host name/address"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
server_address = argv[c];
}
else {
- usage (_("Host name was not supplied\n"));
+ usage (_("Hostname was not supplied\n"));
}
}
@@ -314,9 +315,6 @@
-
-
-
void
print_help (void)
{
@@ -356,7 +354,6 @@
-
void
print_usage (void)
{
Index: check_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ssh.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- check_ssh.c 1 Dec 2004 19:33:45 -0000 1.16
+++ check_ssh.c 1 Dec 2004 23:54:51 -0000 1.17
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
#include "common.h"
@@ -44,6 +46,8 @@
int ssh_connect (char *haddr, int hport, char *remote_version);
+
+
int
main (int argc, char **argv)
{
@@ -54,7 +58,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_ssh: could not parse arguments\n"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
@@ -69,6 +73,7 @@
}
+
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -104,8 +109,9 @@
switch (c) {
case '?': /* help */
- usage (_("Unknow argument\n"));
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'V': /* version */
print_revision (progname, revision);
exit (STATE_OK);
@@ -188,6 +194,7 @@
*
*-----------------------------------------------------------------------*/
+
int
ssh_connect (char *haddr, int hport, char *remote_version)
{
@@ -240,6 +247,8 @@
}
}
+
+
void
print_help (void)
{
@@ -272,6 +281,8 @@
printf (_(UT_SUPPORT));
}
+
+
void
print_usage (void)
{
Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- check_swap.c 23 Nov 2004 23:53:16 -0000 1.32
+++ check_swap.c 1 Dec 2004 23:54:51 -0000 1.33
@@ -326,7 +326,6 @@
-
int
check_swap (int usp, long unsigned int free_swap)
{
@@ -346,6 +345,7 @@
}
+
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -420,7 +420,9 @@
print_help ();
exit (STATE_OK);
case '?': /* error */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -450,8 +452,6 @@
-
-
int
validate_arguments (void)
{
@@ -472,9 +472,6 @@
-
-
-
void
print_help (void)
{
@@ -514,7 +511,6 @@
-
void
print_usage (void)
{
Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- check_pgsql.c 24 Nov 2004 00:46:39 -0000 1.18
+++ check_pgsql.c 1 Dec 2004 23:54:51 -0000 1.19
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
#define DEFAULT_DB "template1"
@@ -55,7 +57,7 @@
const char *revision = "$Revision$";
const char *copyright = "1999-2003";
const char *email = "nagiosplug-devel at lists.sourceforge.net";
-
+
/******************************************************************************
@@ -110,8 +112,6 @@
<title>Functions</title>
-@@
******************************************************************************/
-
-
@@ -133,7 +133,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage ("Could not parse arguments");
+ usage (_("check_pgsql: could not parse arguments\n"));
/* Set signal handling and alarm */
if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
@@ -151,7 +151,7 @@
/* check to see that the backend connection was successfully made */
if (PQstatus (conn) == CONNECTION_BAD) {
- printf (_("PGSQL: CRITICAL - no connection to '%s' (%s).\n"),
+ printf (_("CRITICAL - no connection to '%s' (%s).\n"),
dbName, PQerrorMessage (conn));
PQfinish (conn);
return STATE_CRITICAL;
@@ -166,13 +166,13 @@
status = STATE_OK;
}
PQfinish (conn);
- printf (_("PGSQL: %s - database %s (%d sec.)|%s\n"),
+ printf (_(" %s - database %s (%d sec.)|%s\n"),
state_text(status), dbName, elapsed_time,
fperfdata("time", elapsed_time, "s",
(int)twarn, twarn, (int)tcrit, tcrit, TRUE, 0, FALSE,0));
return status;
}
-
+
/* process command-line arguments */
@@ -206,8 +206,9 @@
switch (c) {
case '?': /* usage */
- usage3 (_("Unknown argument"), optopt);
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'h': /* help */
print_help ();
exit (STATE_OK);
@@ -222,25 +223,25 @@
break;
case 'c': /* critical time threshold */
if (!is_nonnegative (optarg))
- usage2 (_("Invalid critical threshold"), optarg);
+ usage2 (_("Critical threshold must be a positive integer"), optarg);
else
tcrit = strtod (optarg, NULL);
break;
case 'w': /* warning time threshold */
if (!is_nonnegative (optarg))
- usage2 (_("Invalid critical threshold"), optarg);
+ usage2 (_("Critical threshold must be a positive integer"), optarg);
else
twarn = strtod (optarg, NULL);
break;
case 'H': /* host */
if (!is_host (optarg))
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
else
pghost = optarg;
break;
case 'P': /* port */
if (!is_integer (optarg))
- usage2 (_("Port must be an integer"), optarg);
+ usage2 (_("Port must be a positive integer"), optarg);
else
pgport = optarg;
break;
@@ -287,12 +288,13 @@
-@@
******************************************************************************/
+
+
int
validate_arguments ()
{
return OK;
}
-
/******************************************************************************
@@ -315,6 +317,8 @@
-@@
******************************************************************************/
+
+
int
is_pg_dbname (char *dbname)
{
@@ -355,6 +359,8 @@
-@@
******************************************************************************/
+
+
int
is_pg_logname (char *username)
{
@@ -370,8 +376,6 @@
</article>
-@@
******************************************************************************/
-
-
@@ -386,7 +390,7 @@
printf (_(COPYRIGHT), copyright, email);
- printf (_("Test whether a PostgreSQL DBMS is accepting connections.\n\n"));
+ printf (_("Test whether a PostgreSQL Database is accepting connections.\n\n"));
print_usage ();
@@ -431,7 +435,6 @@
-
void
print_usage (void)
{
@@ -444,4 +447,3 @@
%s (-V | --version) for version information\n"),
progname, progname);
}
-
Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- check_snmp.c 24 Nov 2004 00:46:39 -0000 1.39
+++ check_snmp.c 1 Dec 2004 23:54:51 -0000 1.40
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_snmp";
@@ -118,9 +120,6 @@
-
-
-
int
main (int argc, char **argv)
{
@@ -158,7 +157,7 @@
miblist = strdup (DEFAULT_MIBLIST);
if (process_arguments (argc, argv) == ERROR)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_snmp: could not parse arguments\n"));
/* create the command line to execute */
asprintf (&command_line, "%s -t 1 -r %d -m %s -v %s %s %s:%s %s",
@@ -344,9 +343,6 @@
-
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -402,7 +398,9 @@
switch (c) {
case '?': /* usage */
- usage3 ("Unknown argument", optopt);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'h': /* help */
print_help ();
exit (STATE_OK);
@@ -601,8 +599,6 @@
}
-
-
/******************************************************************************
@@-
@@ -623,6 +619,8 @@
-@@
******************************************************************************/
+
+
int
validate_arguments ()
{
@@ -665,7 +663,6 @@
asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd);
}
-
}
else {
printf (_("Invalid SNMP version: %s\n"), proto);
@@ -673,17 +670,11 @@
exit (STATE_UNKNOWN);
}
-
-
-
return OK;
}
-
-
-
char *
clarify_message (char *msg)
{
@@ -721,7 +712,6 @@
-
int
check_num (int i)
{
@@ -766,7 +756,6 @@
-
int
lu_getll (unsigned long *ll, char *str)
{
@@ -782,7 +771,6 @@
-
int
lu_getul (unsigned long *ul, char *str)
{
@@ -798,7 +786,6 @@
-
/* trim leading whitespace
if there is a leading quote, make sure it balances */
@@ -815,7 +802,6 @@
-
/* if there's a leading quote, advance to the trailing quote
set the trailing quote to '\x0'
if the string continues, advance beyond the comma */
@@ -851,9 +837,6 @@
-
-
-
void
print_help (void)
{
@@ -960,6 +943,8 @@
printf (_(UT_SUPPORT));
}
+
+
void
print_usage (void)
{
Index: check_real.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_real.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- check_real.c 24 Nov 2004 00:46:39 -0000 1.14
+++ check_real.c 1 Dec 2004 23:54:51 -0000 1.15
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_real";
@@ -50,9 +52,6 @@
-
-
-
int
main (int argc, char **argv)
{
@@ -66,7 +65,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_real: could not parse arguments\n"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
@@ -251,9 +250,6 @@
-
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -303,7 +299,7 @@
else if (is_host (optarg))
server_address = optarg;
else
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
break;
case 'e': /* string to expect in response header */
server_expect = optarg;
@@ -316,7 +312,7 @@
server_port = atoi (optarg);
}
else {
- usage (_("Server port must be a positive integer\n"));
+ usage (_("Port must be a positive integer\n"));
}
break;
case 'w': /* warning time threshold */
@@ -325,7 +321,7 @@
check_warning_time = TRUE;
}
else {
- usage (_("Warning time must be a nonnegative integer\n"));
+ usage (_("Warning time must be a positive integer\n"));
}
break;
case 'c': /* critical time threshold */
@@ -355,7 +351,9 @@
print_help ();
exit (STATE_OK);
case '?': /* usage */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -365,7 +363,7 @@
server_address = argv[c++];
}
else {
- usage2 (_("Invalid host name"), argv[c]);
+ usage2 (_("Invalid hostname/address"), argv[c]);
}
}
@@ -383,8 +381,6 @@
-
-
int
validate_arguments (void)
{
@@ -393,8 +389,6 @@
-
-
void
print_help (void)
{
@@ -439,8 +433,6 @@
-
-
void
print_usage (void)
{
Index: netutils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- netutils.c 1 Dec 2004 08:28:36 -0000 1.20
+++ netutils.c 1 Dec 2004 23:54:51 -0000 1.21
@@ -27,6 +27,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+* $Id$
+*
****************************************************************************/
#include "common.h"
@@ -104,7 +106,7 @@
send_result = send (sd, send_buffer, strlen (send_buffer), 0);
if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
- printf ("send() failed\n");
+ printf ("Send failed\n");
result = STATE_WARNING;
}
@@ -313,7 +315,7 @@
send_result = send (sd, send_buffer, strlen (send_buffer), 0);
if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
- printf ("send() failed\n");
+ printf ("Send failed\n");
result = STATE_WARNING;
}
@@ -337,7 +339,7 @@
if (recv_result == -1) {
strcpy (recv_buffer, "");
if (proto != IPPROTO_TCP)
- printf ("recv() failed\n");
+ printf ("Receive failed\n");
result = STATE_WARNING;
}
else
Index: netutils.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- netutils.h 29 Feb 2004 04:09:34 -0000 1.9
+++ netutils.h 1 Dec 2004 23:54:51 -0000 1.10
@@ -28,6 +28,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+* $Id$
+*
******************************************************************************/
#include "config.h"
Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- check_ups.c 24 Nov 2004 00:46:39 -0000 1.15
+++ check_ups.c 1 Dec 2004 23:54:51 -0000 1.16
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_ups";
@@ -90,7 +92,7 @@
data = strdup ("");
if (process_arguments (argc, argv) != OK)
- usage ("Invalid command arguments supplied\n");
+ usage (_("check_ups: could not parse arguments\n"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
@@ -287,7 +289,7 @@
if (get_ups_variable ("STATUS", recv_buffer, sizeof (recv_buffer)) !=
STATE_OK) {
- printf ("Invalid response received from hostn");
+ printf ("Invalid response received from host\n");
return ERROR;
}
@@ -419,8 +421,6 @@
-
-
/* Command line: CHECK_UPS <host_address> [-u ups] [-p port] [-v variable]
[-wv warn_value] [-cv crit_value] [-to to_sec] */
@@ -466,13 +466,15 @@
switch (c) {
case '?': /* help */
- usage3 ("Unknown option", optopt);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'H': /* hostname */
if (is_host (optarg)) {
server_address = optarg;
}
else {
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
break;
case 'u': /* ups name */
@@ -483,7 +485,7 @@
server_port = atoi (optarg);
}
else {
- usage2 ("Server port must be a positive integer", optarg);
+ usage2 ("Port must be a positive integer", optarg);
}
break;
case 'c': /* critical time threshold */
@@ -492,7 +494,7 @@
check_crit = TRUE;
}
else {
- usage2 ("Critical time must be a nonnegative integer", optarg);
+ usage2 ("Critical time must be a positive integer", optarg);
}
break;
case 'w': /* warning time threshold */
@@ -501,7 +503,7 @@
check_warn = TRUE;
}
else {
- usage2 ("Warning time must be a nonnegative integer", optarg);
+ usage2 ("Warning time must be a positive integer", optarg);
}
break;
case 'v': /* variable */
@@ -521,11 +523,11 @@
socket_timeout = atoi (optarg);
}
else {
- usage ("Time interval must be a nonnegative integer\n");
+ usage ("Time interval must be a positive integer\n");
}
break;
case 'V': /* version */
- print_revision (progname, "$Revision$");
+ print_revision (progname, revision);
exit (STATE_OK);
case 'h': /* help */
print_help ();
@@ -538,7 +540,7 @@
if (is_host (argv[optind]))
server_address = argv[optind++];
else
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
if (server_address == NULL)
@@ -549,8 +551,6 @@
-
-
int
validate_arguments (void)
{
@@ -559,9 +559,6 @@
-
-
-
void
print_help (void)
{
@@ -617,7 +614,6 @@
-
void
print_usage (void)
{
Index: check_nwstat.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nwstat.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- check_nwstat.c 24 Nov 2004 04:35:40 -0000 1.16
+++ check_nwstat.c 1 Dec 2004 23:54:51 -0000 1.17
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_nwstat";
@@ -80,9 +82,6 @@
-
-
-
int
main(int argc, char **argv) {
int result;
@@ -123,7 +122,7 @@
textdomain (PACKAGE);
if (process_arguments(argc,argv)==ERROR)
- usage(_("Could not parse arguments\n"));
+ usage(_("check_nwstat: could not parse arguments\n"));
/* initialize alarm signal handling */
signal(SIGALRM,socket_timeout_alarm_handler);
@@ -609,10 +608,10 @@
if (time_sync_status==0) {
result=STATE_CRITICAL;
- asprintf (&output_message,_("Critical: Time not in sync with network!"));
+ asprintf (&output_message,_("CRITICAL - Time not in sync with network!"));
}
else {
- asprintf (&output_message,_("OK! Time in sync with network!"));
+ asprintf (&output_message,_("OK - Time in sync with network!"));
}
/* check LRU sitting time in secondss */
@@ -710,7 +709,9 @@
return result;
}
-
+
+
+
/* process command-line arguments */
int process_arguments(int argc, char **argv) {
int c;
@@ -896,9 +897,6 @@
-
-
-
void print_help(void)
{
char *myport;
@@ -987,7 +985,6 @@
-
void print_usage(void)
{
printf (_("\
Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- check_hpjd.c 24 Nov 2004 06:36:13 -0000 1.21
+++ check_hpjd.c 1 Dec 2004 23:54:51 -0000 1.22
@@ -14,6 +14,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+* $Id$
*****************************************************************************/
#include "common.h"
@@ -84,7 +85,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_hpjd: could not parse arguments\n"));
/* removed ' 2>1' at end of command 10/27/1999 - EG */
/* create the query string */
@@ -285,8 +286,6 @@
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -321,7 +320,7 @@
address = strscpy(address, optarg) ;
}
else {
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
break;
case 'C': /* community */
@@ -334,7 +333,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -344,7 +345,7 @@
address = argv[c++];
}
else {
- usage2 (_("Invalid host name"), argv[c]);
+ usage2 (_("Invalid hostname/address"), argv[c]);
}
}
@@ -360,8 +361,6 @@
-
-
int
validate_arguments (void)
{
@@ -370,9 +369,6 @@
-
-
-
void
print_help (void)
{
@@ -398,7 +394,6 @@
-
void
print_usage (void)
{
Index: popen.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/popen.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- popen.c 10 Aug 2003 06:53:22 -0000 1.7
+++ popen.c 1 Dec 2004 23:54:51 -0000 1.8
@@ -16,6 +16,8 @@
* path passed to the exec'd program are esstially empty. (popen create a shell
* and passes the environment to it).
*
+ * $Id$
+ *
******************************************************************************/
#include "common.h"
Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- check_procs.c 24 Nov 2004 00:46:39 -0000 1.29
+++ check_procs.c 1 Dec 2004 23:54:51 -0000 1.30
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_procs";
@@ -73,9 +75,6 @@
-
-
-
int
main (int argc, char **argv)
{
@@ -117,8 +116,7 @@
metric = METRIC_PROCS;
if (process_arguments (argc, argv) == ERROR)
- usage (_("Unable to parse command line\n"));
-
+ usage (_("check_procs: could not parse arguments\n"));
/* Set signal handling and alarm timeout */
if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
@@ -127,7 +125,6 @@
}
alarm (timeout_interval);
-
if (verbose >= 2)
printf (_("CMD: %s\n"), PS_COMMAND);
@@ -296,9 +293,6 @@
-
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -338,6 +332,7 @@
switch (c) {
case '?': /* help */
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
print_usage ();
exit (STATE_UNKNOWN);
case 'h': /* help */
@@ -495,7 +490,6 @@
-
int
validate_arguments ()
{
@@ -543,9 +537,6 @@
-
-
-
/* Check thresholds against value */
int
check_thresholds (int value)
@@ -580,9 +571,6 @@
-
-
-
void
print_help (void)
{
@@ -671,6 +659,8 @@
printf (_(UT_SUPPORT));
}
+
+
void
print_usage (void)
{
@@ -681,3 +671,4 @@
printf (_(UT_HLP_VRS), progname, progname);
}
+
Index: check_overcr.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_overcr.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- check_overcr.c 24 Nov 2004 00:46:39 -0000 1.9
+++ check_overcr.c 1 Dec 2004 23:54:51 -0000 1.10
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_overcr";
@@ -84,7 +86,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage ("Could not parse arguments\n");
+ usage (_("check_overcr: could not parse arguments\n"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
@@ -281,8 +283,6 @@
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -401,7 +401,9 @@
}
return OK;
}
-
+
+
+
void
print_usage (void)
{
@@ -412,6 +414,8 @@
printf (_(UT_HLP_VRS), progname, progname);
}
+
+
void
print_help (void)
{
Index: check_nt.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nt.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- check_nt.c 22 Nov 2004 22:30:54 -0000 1.25
+++ check_nt.c 1 Dec 2004 23:54:51 -0000 1.26
@@ -26,6 +26,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+ * $Id$
+ *
*****************************************************************************/
#include "common.h"
@@ -109,7 +111,7 @@
textdomain (PACKAGE);
if(process_arguments(argc,argv)==ERROR)
- usage(_("Could not parse arguments\n"));
+ usage(_("check_nt: could not parse arguments\n"));
/* initialize alarm signal handling */
signal(SIGALRM,socket_timeout_alarm_handler);
@@ -188,7 +190,7 @@
updays = uptime / 86400;
uphours = (uptime % 86400) / 3600;
upminutes = ((uptime % 86400) % 3600) / 60;
- asprintf(&output_message,_("System Uptime : %u day(s) %u hour(s) %u minute(s)"),updays,uphours, upminutes);
+ asprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s)"),updays,uphours, upminutes);
return_code=STATE_OK;
break;
@@ -427,9 +429,6 @@
-
-
-
/* process command-line arguments */
int process_arguments(int argc, char **argv){
int c;
@@ -557,9 +556,6 @@
-
-
-
void fetch_data (const char *address, int port, const char *sendb) {
int result;
@@ -603,9 +599,6 @@
-
-
-
void print_help(void)
{
print_revision(progname,"$Revision$");
@@ -681,7 +674,6 @@
-
void print_usage(void)
{
printf(_("\
Index: check_load.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_load.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- check_load.c 24 Nov 2004 00:46:39 -0000 1.16
+++ check_load.c 1 Dec 2004 23:54:51 -0000 1.17
@@ -13,6 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
******************************************************************************/
@@ -75,7 +77,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage ("failed processing arguments\n");
+ usage (_("check_load: could not parse arguments\n"));
#if HAVE_GETLOADAVG==1
result = getloadavg (la, 3);
@@ -227,7 +229,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
Index: urlize.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/urlize.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- urlize.c 30 Nov 2004 00:24:26 -0000 1.12
+++ urlize.c 1 Dec 2004 23:54:51 -0000 1.13
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "urlize";
@@ -69,8 +71,9 @@
break;
case '?':
default:
- usage3 (_("Unknown argument"), optopt);
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -121,9 +124,6 @@
-
-
-
void
print_help (void)
{
@@ -159,7 +159,6 @@
-
void
print_usage (void)
{
Index: check_mrtg.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtg.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- check_mrtg.c 24 Nov 2004 00:46:39 -0000 1.14
+++ check_mrtg.c 1 Dec 2004 23:54:51 -0000 1.15
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_mrtg";
@@ -58,7 +60,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_mrtg: could not parse arguments\n"));
/* open the MRTG log file for reading */
fp = fopen (log_file, "r");
@@ -229,7 +231,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
Index: check_dummy.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dummy.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- check_dummy.c 24 Nov 2004 00:46:38 -0000 1.8
+++ check_dummy.c 1 Dec 2004 23:54:51 -0000 1.9
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
#include "common.h"
Index: gethostbyname.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/gethostbyname.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gethostbyname.c 15 Mar 2003 01:25:35 -0000 1.1
+++ gethostbyname.c 1 Dec 2004 23:54:51 -0000 1.2
@@ -17,6 +17,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
*/
#ifdef HAVE_CONFIG_H
Index: gethostbyname.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/gethostbyname.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gethostbyname.h 15 Mar 2003 01:25:35 -0000 1.1
+++ gethostbyname.h 1 Dec 2004 23:54:51 -0000 1.2
@@ -17,6 +17,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
*/
/*************************************************************************
Index: check_radius.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_radius.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- check_radius.c 24 Nov 2004 00:46:39 -0000 1.11
+++ check_radius.c 1 Dec 2004 23:54:51 -0000 1.12
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_radius";
@@ -94,6 +96,8 @@
-@@
******************************************************************************/
+
+
int
main (int argc, char **argv)
{
@@ -109,7 +113,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_radius: could not parse arguments\n"));
str = strdup ("dictionary");
if ((config_file && rc_read_config (config_file)) ||
@@ -199,7 +203,7 @@
if (is_intpos (argv[7]))
port = atoi (argv[7]);
else
- usage (_("Server port must be a positive integer"));
+ usage (_("Port must be a positive integer"));
expect = argv[8];
return OK;
}
@@ -227,7 +231,7 @@
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE) {
- usage2 (_("Invalid host name/address"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
server = optarg;
break;
@@ -235,7 +239,7 @@
if (is_intnonneg (optarg))
port = atoi (optarg);
else
- usage (_("Server port must be a positive integer"));
+ usage (_("Port must be a positive integer"));
break;
case 'u': /* username */
username = optarg;
@@ -271,9 +275,6 @@
-
-
-
void
print_help (void)
{
@@ -329,7 +330,6 @@
-
void
print_usage (void)
{
Index: negate.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/negate.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- negate.c 24 Nov 2004 00:46:40 -0000 1.15
+++ negate.c 1 Dec 2004 23:54:51 -0000 1.16
@@ -13,6 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
@@-<article>
@@ -69,6 +71,8 @@
void print_help (void);
void print_usage (void);
+
+
int
main (int argc, char **argv)
{
@@ -80,7 +84,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("negate: could not parse arguments\n"));
/* Set signal handling and alarm */
if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR)
@@ -125,8 +129,6 @@
else
exit (result);
}
-
-
/******************************************************************************
@@-
@@ -146,6 +148,8 @@
-@@
******************************************************************************/
+
+
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -169,7 +173,9 @@
switch (c) {
case '?': /* help */
- usage3 (_("Unknown argument"), optopt);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
break;
case 'h': /* help */
print_help ();
@@ -207,6 +213,8 @@
-@@
******************************************************************************/
+
+
int
validate_arguments ()
{
@@ -225,9 +233,6 @@
-
-
-
void
print_help (void)
{
@@ -265,8 +270,6 @@
-
-
void
print_usage (void)
{
Index: check_by_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_by_ssh.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- check_by_ssh.c 1 Dec 2004 19:33:45 -0000 1.23
+++ check_by_ssh.c 1 Dec 2004 23:54:51 -0000 1.24
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
const char *progname = "check_by_ssh";
@@ -67,7 +69,7 @@
/* process arguments */
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_by_ssh: could not parse arguments\n"));
/* Set signal handling and alarm timeout */
@@ -214,10 +216,11 @@
switch (c) {
case '?': /* help */
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
print_usage ();
exit (STATE_UNKNOWN);
case 'V': /* version */
- print_revision (progname, "$Revision$");
+ print_revision (progname, revision);
exit (STATE_OK);
case 'h': /* help */
print_help ();
@@ -233,12 +236,12 @@
break;
case 'H': /* host */
if (!is_host (optarg))
- usage2 (_("Invalid hostname/adress"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
hostname = optarg;
break;
case 'p': /* port number */
if (!is_integer (optarg))
- usage2 (_("port must be a positive integer"), optarg);
+ usage2 (_("Port must be a positive integer"), optarg);
asprintf (&comm,"%s -p %s", comm, optarg);
break;
case 'O': /* output file */
@@ -292,7 +295,7 @@
if (c <= argc) {
die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname);
} else if (!is_host (argv[c]))
- die (STATE_UNKNOWN, "%s: %s %s\n", progname, _("Invalid host name"), argv[c]);
+ die (STATE_UNKNOWN, "%s: %s %s\n", progname, _("Invalid hostname/address"), argv[c]);
hostname = argv[c++];
}
@@ -317,8 +320,6 @@
-
-
int
validate_arguments (void)
{
@@ -408,8 +409,6 @@
-
-
void
print_usage (void)
{
Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- check_disk.c 1 Dec 2004 19:33:45 -0000 1.48
+++ check_disk.c 1 Dec 2004 23:54:51 -0000 1.49
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
const char *progname = "check_disk";
@@ -133,7 +135,7 @@
static struct mount_entry *mount_list;
-
+
int
main (int argc, char **argv)
{
@@ -162,7 +164,7 @@
mount_list = read_filesystem_list (0);
if (process_arguments (argc, argv) != OK)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_disk: could not parse arguments\n"));
for (me = mount_list; me; me = me->me_next) {
@@ -240,7 +242,6 @@
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -437,8 +438,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Unknow argument\n"));
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -479,6 +481,7 @@
}
+
void
print_path (const char *mypath)
{
@@ -490,6 +493,8 @@
return;
}
+
+
int
validate_arguments (uintmax_t w, uintmax_t c, double wp, double cp, char *mypath)
{
@@ -523,7 +528,6 @@
-
int
check_disk (double usp, double free_disk)
{
@@ -564,8 +568,6 @@
-
-
void
print_help (void)
{
@@ -631,7 +633,6 @@
-
void
print_usage (void)
{
Index: check_udp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_udp.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- check_udp.c 24 Nov 2004 00:46:39 -0000 1.13
+++ check_udp.c 1 Dec 2004 23:54:51 -0000 1.14
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
const char *progname = "check_udp";
@@ -50,7 +52,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage ("\n");
+ usage (_("check_udp: could not parse arguments\n"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
@@ -102,7 +104,6 @@
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -158,19 +159,19 @@
break;
case 'H': /* hostname */
if (is_host (optarg) == FALSE)
- usage2 (_("Invalid host name/address"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
server_address = optarg;
break;
case 'c': /* critical */
if (!is_intnonneg (optarg))
- usage (_("Critical threshold must be a nonnegative integer\n"));
+ usage (_("Critical threshold must be a positive integer\n"));
else
critical_time = atoi (optarg);
check_critical_time = TRUE;
break;
case 'w': /* warning */
if (!is_intnonneg (optarg))
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
else
warning_time = atoi (optarg);
check_warning_time = TRUE;
@@ -183,7 +184,7 @@
break;
case 'p': /* port */
if (!is_intnonneg (optarg))
- usage (_("Server port must be a nonnegative integer\n"));
+ usage (_("Port must be a positive integer\n"));
else
server_port = atoi (optarg);
break;
@@ -199,7 +200,7 @@
c = optind;
if (server_address == NULL && c < argc && argv[c]) {
if (is_host (argv[c]) == FALSE)
- usage2 (_("Invalid host name/address"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
server_address = argv[c++];
}
@@ -214,9 +215,6 @@
-
-
-
void
print_help (void)
{
Index: check_fping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_fping.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- check_fping.c 1 Dec 2004 19:33:45 -0000 1.15
+++ check_fping.c 1 Dec 2004 23:54:51 -0000 1.16
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_fping";
@@ -66,7 +68,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_fping: could not parse arguments\n"));
server = strscpy (server, server_name);
@@ -116,7 +118,6 @@
-
int
textscan (char *buf)
{
@@ -195,7 +196,6 @@
return status;
}
-
@@ -308,8 +308,6 @@
-
-
int
get_threshold (char *arg, char *rv[2])
{
@@ -352,8 +350,6 @@
-
-
void
print_help (void)
{
@@ -398,7 +394,6 @@
-
void
print_usage (void)
{
Index: check_users.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_users.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- check_users.c 24 Nov 2004 00:46:40 -0000 1.11
+++ check_users.c 1 Dec 2004 23:54:51 -0000 1.12
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
const char *progname = "check_users";
@@ -49,7 +51,7 @@
perf = strdup("");
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_users: could not parse arguments\n"));
/* run the command */
child_process = spopen (WHO_COMMAND);
@@ -112,8 +114,6 @@
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -151,13 +151,13 @@
exit (STATE_OK);
case 'c': /* critical */
if (!is_intnonneg (optarg))
- usage (_("Critical threshold must be a nonnegative integer\n"));
+ usage (_("Critical threshold must be a positive integer\n"));
else
cusers = atoi (optarg);
break;
case 'w': /* warning */
if (!is_intnonneg (optarg))
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
else
wusers = atoi (optarg);
break;
@@ -167,14 +167,14 @@
c = optind;
if (wusers == -1 && argc > c) {
if (is_intnonneg (argv[c]) == FALSE)
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
else
wusers = atoi (argv[c++]);
}
if (cusers == -1 && argc > c) {
if (is_intnonneg (argv[c]) == FALSE)
- usage (_("Warning threshold must be a nonnegative integer\n"));
+ usage (_("Warning threshold must be a positive integer\n"));
else
cusers = atoi (argv[c]);
}
@@ -184,9 +184,6 @@
-
-
-
void
print_help (void)
{
@@ -214,7 +211,6 @@
-
void
print_usage (void)
{
Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- check_ping.c 24 Nov 2004 00:46:39 -0000 1.29
+++ check_ping.c 1 Dec 2004 23:54:51 -0000 1.30
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_ping";
@@ -60,8 +62,6 @@
-
-
int
main (int argc, char **argv)
{
@@ -79,7 +79,7 @@
addresses[0] = NULL;
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments"));
+ usage (_("check_ping: could not parse arguments\n"));
/* Set signal handling and alarm */
if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
@@ -159,9 +159,6 @@
-
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -198,8 +195,9 @@
switch (c) {
case '?': /* usage */
- usage3 (_("Unknown argument"), optopt);
- break;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'h': /* help */
print_help ();
exit (STATE_OK);
@@ -270,7 +268,7 @@
if (addresses[0] == NULL) {
if (is_host (argv[c]) == FALSE) {
- usage2 (_("Invalid host name/address"), argv[c]);
+ usage2 (_("Invalid hostname/address"), argv[c]);
} else {
addresses[0] = argv[c++];
n_addresses++;
@@ -335,6 +333,8 @@
return validate_arguments ();
}
+
+
int
get_threshold (char *arg, float *trta, int *tpl)
{
@@ -349,6 +349,8 @@
return STATE_UNKNOWN;
}
+
+
int
validate_arguments ()
{
@@ -389,7 +391,7 @@
for (i=0; i<n_addresses; i++) {
if (is_host(addresses[i]) == FALSE)
- usage2 (_("Invalid host name/address"), addresses[i]);
+ usage2 (_("Invalid hostname/address"), addresses[i]);
}
return OK;
@@ -397,9 +399,6 @@
-
-
-
int
run_ping (const char *cmd, const char *addr)
{
@@ -444,7 +443,7 @@
/* check stderr, setting at least WARNING if there is output here */
while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr))
- if (! strstr(buf,"Warning: no SO_TIMESTAMP support, falling back to SIOCGSTAMP"))
+ if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP"))
result = max_state (STATE_WARNING, error_scan (buf, addr));
(void) fclose (child_stderr);
@@ -462,17 +461,15 @@
-
-
int
error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
{
if (strstr (buf, "Network is unreachable"))
- die (STATE_CRITICAL, _("PING CRITICAL - Network unreachable (%s)"), addr);
+ die (STATE_CRITICAL, _("CRITICAL - Network unreachable (%s)"), addr);
else if (strstr (buf, "Destination Host Unreachable"))
- die (STATE_CRITICAL, _("PING CRITICAL - Host Unreachable (%s)"), addr);
+ die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)"), addr);
else if (strstr (buf, "unknown host" ))
- die (STATE_CRITICAL, _("PING CRITICAL - Host not found (%s)"), addr);
+ die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)"), addr);
if (strstr (buf, "(DUP!)") || strstr (buf, "DUPLICATES FOUND")) {
if (warn_text == NULL)
@@ -488,9 +485,6 @@
-
-
-
void
print_usage (void)
{
@@ -500,6 +494,8 @@
printf (_(UT_HLP_VRS), progname, progname);
}
+
+
void
print_help (void)
{
Index: check_dns.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dns.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- check_dns.c 1 Dec 2004 19:33:45 -0000 1.30
+++ check_dns.c 1 Dec 2004 23:54:51 -0000 1.31
@@ -16,6 +16,8 @@
LIMITATION: nslookup on Solaris 7 can return output over 2 lines, which will not
be picked up by this plugin
+
+ $Id$
******************************************************************************/
@@ -71,7 +73,7 @@
}
if (process_arguments (argc, argv) != OK) {
- print_usage ();
+ usage (_("check_dns: could not parse arguments\n"));
return STATE_UNKNOWN;
}
@@ -213,6 +215,8 @@
return result;
}
+
+
int
error_scan (char *input_buffer)
{
@@ -261,6 +265,8 @@
}
+
+
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -320,7 +326,7 @@
/* TODO: this is_host check is probably unnecessary. */
/* Better to confirm nslookup response matches */
if (is_host (optarg) == FALSE) {
- printf (_("Invalid server name/address\n\n"));
+ printf (_("Invalid hostname/address\n\n"));
print_usage ();
exit (STATE_UNKNOWN);
}
@@ -370,6 +376,8 @@
return validate_arguments ();
}
+
+
int
validate_arguments ()
{
@@ -381,9 +389,6 @@
-
-
-
void
print_help (void)
{
@@ -419,7 +424,6 @@
-
void
print_usage (void)
{
Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- check_dig.c 1 Dec 2004 19:33:45 -0000 1.28
+++ check_dig.c 1 Dec 2004 23:54:51 -0000 1.29
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
*****************************************************************************/
#include "common.h"
@@ -128,7 +130,6 @@
asprintf (&output, _("Server not found in ANSWER SECTION"));
result = STATE_WARNING;
}
-
}
}
@@ -181,8 +182,6 @@
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -215,7 +214,9 @@
switch (c) {
case '?': /* help */
- usage3 (_("Unknown argument"), optopt);
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
case 'h': /* help */
print_help ();
exit (STATE_OK);
@@ -227,7 +228,7 @@
dns_server = optarg;
}
else {
- usage2 (_("Invalid hostname/adress"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
break;
case 'p': /* server port */
@@ -235,7 +236,7 @@
server_port = atoi (optarg);
}
else {
- usage2 (_("port must be a positive integer"), optarg);
+ usage2 (_("Port must be a positive integer"), optarg);
}
break;
case 'l': /* address to lookup */
@@ -284,7 +285,7 @@
dns_server = argv[c];
}
else {
- usage2 (_("Invalid hostname/adress"), argv[c]);
+ usage2 (_("Invalid hostname/address"), argv[c]);
}
}
else {
@@ -297,8 +298,6 @@
-
-
int
validate_arguments (void)
{
@@ -307,9 +306,6 @@
-
-
-
void
print_help (void)
{
@@ -354,7 +350,6 @@
-
void
print_usage (void)
{
Index: check_ide-smart.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ide-smart.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- check_ide-smart.c 30 Nov 2004 00:25:21 -0000 1.5
+++ check_ide-smart.c 1 Dec 2004 23:54:51 -0000 1.6
@@ -2,7 +2,7 @@
* check_ide-smart v.1 - hacked version of ide-smart for Nagios
* Copyright (C) 2000 Robert Dale <rdale at digital-mission.com>
*
- * Net Saint - http://www.nagios.org
+ * Nagios - http://www.nagios.org
*
* Notes:
* ide-smart has the same functionality as before. Some return
@@ -33,6 +33,8 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
*/
#include "common.h"
@@ -137,6 +139,8 @@
SMART_CMD_AUTO_OFFLINE
};
+
+
char *
get_offline_text (int status)
{
@@ -146,9 +150,11 @@
return offline_status_text[i].text;
}
}
- return "unknown";
+ return "UNKNOW";
}
+
+
int
smart_read_values (int fd, values_t * values)
{
@@ -160,13 +166,15 @@
args[3] = 1;
if (ioctl (fd, HDIO_DRIVE_CMD, &args)) {
e = errno;
- printf (_("CRITICAL: SMART_READ_VALUES: %s\n"), strerror (errno));
+ printf (_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror (errno));
return e;
}
memcpy (values, args + 4, 512);
return 0;
}
+
+
int
values_not_passed (values_t * p, thresholds_t * t)
{
@@ -190,6 +198,8 @@
return (passed ? -failed : 2);
}
+
+
int
net_saint (values_t * p, thresholds_t * t)
{
@@ -225,24 +235,24 @@
}
switch (status) {
case PREFAILURE:
- printf (_("CRITICAL: %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"),
+ printf (_("CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"),
prefailure,
prefailure > 1 ? 's' : ' ',
failed,
total);
break;
case ADVISORY:
- printf (_("WARNING: %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"),
+ printf (_("WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"),
advisory,
advisory > 1 ? "ies" : "y",
failed,
total);
break;
case OPERATIONAL:
- printf (_("Status: Operational (%d/%d tests passed)\n"), passed, total);
+ printf (_("STATUS - Operational (%d/%d tests passed)\n"), passed, total);
break;
default:
- printf (_("Error: Status '%d' uknown. %d/%d tests passed\n"), status,
+ printf (_("ERROR - Status '%d' uknown. %d/%d tests passed\n"), status,
passed, total);
status = -1;
break;
@@ -250,6 +260,8 @@
return status;
}
+
+
void
print_value (value_t * p, threshold_t * t)
{
@@ -259,6 +271,8 @@
p->value > t->threshold ? "Passed" : "Failed");
}
+
+
void
print_values (values_t * p, thresholds_t * t)
{
@@ -291,6 +305,8 @@
p->smart_capability & 2 ? "AutoSave" : "");
}
+
+
void
print_thresholds (thresholds_t * p)
{
@@ -320,12 +336,14 @@
if (ioctl (fd, HDIO_DRIVE_CMD, &args)) {
e = errno;
if (show_error) {
- printf (_("CRITICAL: %s: %s\n"), smart_command[command].text, strerror (errno));
+ printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno));
}
}
return e;
}
+
+
int
smart_read_thresholds (int fd, thresholds_t * thresholds)
{
@@ -337,13 +355,15 @@
args[3] = 1;
if (ioctl (fd, HDIO_DRIVE_CMD, &args)) {
e = errno;
- printf (_("CRITICAL: SMART_READ_THRESHOLDS: %s\n"), strerror (errno));
+ printf (_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror (errno));
return e;
}
memcpy (thresholds, args + 4, 512);
return 0;
}
+
+
void
show_version ()
{
@@ -352,6 +372,8 @@
printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar at lightside.dhis.org>\n");
}
+
+
void
show_help ()
{
@@ -373,6 +395,8 @@
-V, --version\n"));
}
+
+
int
main (int argc, char *argv[])
{
@@ -433,8 +457,9 @@
show_version ();
return 0;
default:
- printf (_("Try `%s --help' for more information.\n"), argv[0]);
- return 1;
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
if (optind < argc) {
@@ -450,12 +475,12 @@
fd = open (device, O_RDONLY);
if (fd < 0) {
- printf (_("CRITICAL: Couldn't open device: %s\n"), strerror (errno));
+ 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"));
+ printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
return 2;
}
@@ -489,4 +514,3 @@
}
return retval;
}
-
Index: utils.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- utils.h 20 Feb 2004 05:21:21 -0000 1.19
+++ utils.h 1 Dec 2004 23:54:51 -0000 1.20
@@ -13,6 +13,8 @@
/* Standardize version information, termination */
+/* $Id$ */
+
void support (void);
char *clean_revstring (const char *revstring);
void print_revision (const char *, const char *);
Index: check_mysql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mysql.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- check_mysql.c 24 Nov 2004 00:46:39 -0000 1.15
+++ check_mysql.c 1 Dec 2004 23:54:51 -0000 1.16
@@ -54,7 +54,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_mysql: could not parse arguments\n"));
/* initialize mysql */
mysql_init (&mysql);
@@ -146,8 +146,6 @@
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -183,7 +181,7 @@
db_host = optarg;
}
else {
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
break;
case 'd': /* hostname */
@@ -208,7 +206,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -221,7 +221,7 @@
db_host = argv[c++];
}
else {
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
else if (strlen(db_user) == 0)
db_user = argv[c++];
@@ -240,8 +240,6 @@
-
-
int
validate_arguments (void)
{
@@ -262,9 +260,6 @@
-
-
-
void
print_help (void)
{
@@ -304,7 +299,6 @@
-
void
print_usage (void)
{
Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- utils.c 3 Mar 2004 12:33:15 -0000 1.37
+++ utils.c 1 Dec 2004 23:54:51 -0000 1.38
@@ -315,9 +315,6 @@
}
-
-
-
/******************************************************************************
*
* Copies one string to another. Any previously existing data in
@@ -343,8 +340,6 @@
-
-
/******************************************************************************
*
* Returns a pointer to the next line of a multiline string buffer
@@ -414,9 +409,6 @@
}
-
-
-
/******************************************************************************
*
* Like strscpy, except only the portion of the source string up to
@@ -456,8 +448,6 @@
-
-
/******************************************************************************
*
* Like strscat, except only the portion of the source string up to
@@ -499,8 +489,6 @@
}
-
-
/******************************************************************************
*
* Print perfdata in a standard format
Index: getaddrinfo.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/getaddrinfo.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- getaddrinfo.c 15 Mar 2003 01:25:35 -0000 1.1
+++ getaddrinfo.c 1 Dec 2004 23:54:51 -0000 1.2
@@ -22,6 +22,8 @@
*/
/* An emulation of the RFC 2553 / Posix getaddrinfo resolver interface.
+ *
+ * $Id$
*/
#ifdef HAVE_CONFIG_H
Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- check_smtp.c 24 Nov 2004 00:46:39 -0000 1.29
+++ check_smtp.c 1 Dec 2004 23:54:51 -0000 1.30
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_smtp";
@@ -69,9 +71,6 @@
-
-
-
int
main (int argc, char **argv)
{
@@ -90,7 +89,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) != OK)
- usage (_("Incorrect arguments supplied\n"));
+ usage (_("check_smtp: could not parse arguments\n"));
/* initialize the HELO command with the localhostname */
#ifndef HOST_MAX_BYTES
@@ -238,9 +237,6 @@
-
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -292,14 +288,14 @@
server_address = optarg;
}
else {
- usage2 (_("Invalid host name"), optarg);
+ usage2 (_("Invalid hostname/address"), optarg);
}
break;
case 'p': /* port */
if (is_intpos (optarg))
server_port = atoi (optarg);
else
- usage (_("Server port must be a positive integer\n"));
+ usage (_("Port must be a positive integer\n"));
break;
case 'f': /* from argument */
from_arg = optarg;
@@ -334,7 +330,7 @@
check_critical_time = TRUE;
}
else {
- usage (_("Critical time must be a nonnegative integer\n"));
+ usage (_("Critical time must be a positive integer\n"));
}
break;
case 'w': /* warning time threshold */
@@ -343,7 +339,7 @@
check_warning_time = TRUE;
}
else {
- usage (_("Warning time must be a nonnegative integer\n"));
+ usage (_("Warning time must be a positive integer\n"));
}
break;
case 'v': /* verbose */
@@ -354,7 +350,7 @@
socket_timeout = atoi (optarg);
}
else {
- usage (_("Time interval must be a nonnegative integer\n"));
+ usage (_("Time interval must be a positive integer\n"));
}
break;
case '4':
@@ -374,7 +370,9 @@
print_help ();
exit (STATE_OK);
case '?': /* help */
- usage (_("Invalid argument\n"));
+ printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
}
}
@@ -384,7 +382,7 @@
if (is_host (argv[c]))
server_address = argv[c];
else
- usage2 (_("Invalid host name"), argv[c]);
+ usage2 (_("Invalid hostname/address"), argv[c]);
}
else {
asprintf (&server_address, "127.0.0.1");
@@ -405,8 +403,6 @@
-
-
int
validate_arguments (void)
{
@@ -415,9 +411,6 @@
-
-
-
void
print_help (void)
{
@@ -470,8 +463,6 @@
-
-
void
print_usage (void)
{
@@ -480,6 +471,3 @@
[-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
printf (_(UT_HLP_VRS), progname, progname);
}
-
-
-
Index: check_game.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_game.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- check_game.c 24 Nov 2004 00:46:38 -0000 1.11
+++ check_game.c 1 Dec 2004 23:54:51 -0000 1.12
@@ -14,6 +14,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+* $Id$
*****************************************************************************/
const char *progname = "check_game";
@@ -64,9 +65,12 @@
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- result = process_arguments (argc, argv);
+// result = process_arguments (argc, argv);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage (_("check_game: could not parse arguments\n"));
- if (result != OK) {
+/* if (result != OK) {
printf (_("Incorrect arguments supplied\n"));
printf ("\n");
print_revision (progname, revision);
@@ -75,6 +79,7 @@
printf ("\n");
return STATE_UNKNOWN;
}
+*/
result = STATE_OK;
@@ -302,7 +307,6 @@
-
void
print_help (void)
{
Index: check_nagios.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nagios.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- check_nagios.c 11 Mar 2004 15:17:08 -0000 1.12
+++ check_nagios.c 1 Dec 2004 23:54:51 -0000 1.13
@@ -14,6 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_nagios";
@@ -64,7 +66,7 @@
textdomain (PACKAGE);
if (process_arguments (argc, argv) == ERROR)
- usage (_("Could not parse arguments\n"));
+ usage (_("check_nagios: could not parse arguments\n"));
/* Set signal handling and alarm */
if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
@@ -78,7 +80,7 @@
/* open the status log */
fp = fopen (status_log, "r");
if (fp == NULL) {
- printf (_("Error: Cannot open status log for reading!\n"));
+ printf (_("ERROR - Cannot open status log for reading!\n"));
return STATE_CRITICAL;
}
@@ -178,8 +180,6 @@
-
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
@@ -264,9 +264,6 @@
-
-
-
void
print_help (void)
{
@@ -302,7 +299,6 @@
-
void
print_usage (void)
{
Index: getaddrinfo.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/getaddrinfo.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- getaddrinfo.h 15 Mar 2003 01:25:35 -0000 1.1
+++ getaddrinfo.h 1 Dec 2004 23:54:51 -0000 1.2
@@ -23,7 +23,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* Structure and prototypes aken from RFC 2553 */
+/* Structure and prototypes aken from RFC 2553
+ *
+ * $Id$
+ */
struct addrinfo
{
- Previous message: [Nagiosplug-checkins] nagiosplug/doc RELEASING,NONE,1.1
- Next message: Removal of process_argument return code check (was Re: [Nagiosplug-checkins] nagiosplug/plugins check_by_ssh.c,1.23,1.24 check_dig.c,1.28,1.29 check_disk.c,1.48,1.49 check_dns.c,1.30,1.31 check_dummy.c,1.8,1.9 check_fping.c,1.15,1.16 check_game.c,1.11,1.12 check_hpjd.c,1.21,1.22 check_http.c,1.66,1.67 check_ide-smart.c,1.5,1.6 check_ldap.c,1.17,1.18 check_load.c,1.16,1.17 check_mrtg.c,1.14,1.15 check_mrtgtraf.c,1.14,1.15 check_mysql.c,1.15,1.16 check_nagios.c,1.12,1.13 check_nt.c,1.25,1.26 check_nwstat.c,1.16,1.17 check_overcr.c,1.9,1.10 check_pgsql.c,1.18,1.19 check_ping.c,1.29,1.30 check_procs.c,1.29,1.30 check_radius.c,1.11,1.12 check_real.c,1.14,1.15 check_smtp.c,1.29,1.30 check_snmp.c,1.39,1.40 check_ssh.c,1.16,1.17 check_swap.c,1.32,1.33 check_tcp.c,1.44,1.45 check_time.c,1.14,1.15 check_udp.c,1.13,1.14 check_ups.c,1.15,1.16 check_users.c,1.11,1.12 common.h,1.13,1.14 getaddrinfo.c,1.1,1.2 getaddrinfo.h,1.1,1.2 gethostbyname.c,1.1,1.2 gethostbyname.h,1.1,1.2 ne! gate.c! ,1.15,1.16 netutils.c,1.20,1.21 netutils.h,1.9,1.10 pop! en.c,1.7,1.8 urlize.c,1.12,1.13 utils.c,1.37,1.38 utils.h,1.19,1.20)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commits
mailing list