From 3fc34f5fa1bbffb898aacb6c34dccaac7cda9e7c Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Wed, 14 Sep 2005 14:36:00 +0000 Subject: 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 --- plugins/check_ping.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 6b566608..a6c43c36 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -50,7 +50,7 @@ int cpl = UNKNOWN_PACKET_LOSS; 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 @@ validate_arguments () 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; } -- cgit v1.2.3