From 8c3e7428ae21999e813b288c3d55d3870c9ef258 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 24 Mar 2006 16:12:05 +0000 Subject: udp checks require and send and receive option. Tests updated so if nc is available, will check send and receive working correctly git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1353 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_tcp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/check_tcp.c') diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 5c287b7a..d8fc26e7 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -198,13 +198,17 @@ main (int argc, char **argv) if(flags & FLAG_VERBOSE) { printf("Using service %s\n", SERVICE); - printf("Port: %d\n", PORT); + printf("Port: %d\n", server_port); printf("flags: 0x%x\n", (int)flags); } if(EXPECT && !server_expect_count) server_expect_count++; + if(PROTOCOL==IPPROTO_UDP && !(server_expect_count && server_send)){ + usage(_("With UDP checks, a send/expect string must be specified.")); + } + /* set up the timer */ signal (SIGALRM, socket_timeout_alarm_handler); alarm (socket_timeout); -- cgit v1.2.3-74-g34f1