diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2005-09-14 14:36:00 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2005-09-14 14:36:00 (GMT) |
commit | 3fc34f5fa1bbffb898aacb6c34dccaac7cda9e7c (patch) | |
tree | b15c114f2934103cde7305ed3cd7b2c21b180fc6 | |
parent | 63e9193516f2aa2edbbf7f0dadbdf4694c0821cb (diff) | |
download | monitoring-plugins-3fc34f5fa1bbffb898aacb6c34dccaac7cda9e7c.tar.gz |
Required hostname not flagging as an error
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1220 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_ping.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 6b56660..a6c43c3 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -50,7 +50,7 @@ int cpl = UNKNOWN_PACKET_LOSS; | |||
50 | float wrta = UNKNOWN_TRIP_TIME; | 50 | float wrta = UNKNOWN_TRIP_TIME; |
51 | float crta = UNKNOWN_TRIP_TIME; | 51 | float crta = UNKNOWN_TRIP_TIME; |
52 | char **addresses = NULL; | 52 | char **addresses = NULL; |
53 | int n_addresses; | 53 | int n_addresses = 0; |
54 | int max_addr = 1; | 54 | int max_addr = 1; |
55 | int max_packets = -1; | 55 | int max_packets = -1; |
56 | int verbose = 0; | 56 | int verbose = 0; |
@@ -392,6 +392,11 @@ validate_arguments () | |||
392 | usage2 (_("Invalid hostname/address"), addresses[i]); | 392 | usage2 (_("Invalid hostname/address"), addresses[i]); |
393 | } | 393 | } |
394 | 394 | ||
395 | if (n_addresses == 0) { | ||
396 | printf(_("You must specify a server address or host name\n")); | ||
397 | return ERROR; | ||
398 | } | ||
399 | |||
395 | return OK; | 400 | return OK; |
396 | } | 401 | } |
397 | 402 | ||