[Nagiosplug-checkins] nagiosplug/plugins check_ping.c,1.47,1.48
Ton Voon
tonvoon at users.sourceforge.net
Wed Sep 14 07:38:07 CEST 2005
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2930
Modified Files:
check_ping.c
Log Message:
Required hostname not flagging as an error
Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- check_ping.c 13 Sep 2005 15:48:15 -0000 1.47
+++ check_ping.c 14 Sep 2005 14:36:00 -0000 1.48
@@ -50,7 +50,7 @@
float wrta = UNKNOWN_TRIP_TIME;
float crta = UNKNOWN_TRIP_TIME;
char **addresses = NULL;
-int n_addresses;
+int n_addresses = 0;
int max_addr = 1;
int max_packets = -1;
int verbose = 0;
@@ -392,6 +392,11 @@
usage2 (_("Invalid hostname/address"), addresses[i]);
}
+ if (n_addresses == 0) {
+ printf(_("You must specify a server address or host name\n"));
+ return ERROR;
+ }
+
return OK;
}
More information about the Commits
mailing list