[Nagiosplug-devel] check_udp

John P. Rouillard rouilj at cs.umb.edu
Fri Mar 24 07:47:02 CET 2006


In message <3AF9F8D7-E092-44BD-A005-F7D16F677631 at altinity.com>,
Ton Voon writes:
>The patch looks good, and makes more sense to me now. Out of  
>interest, are there any udp services that would give a response on a  
>connect without the client sending some data?

Well daytime or chargen should work as soon as a udp packet is
transmitted, but if you issue a "connect" (I forget the actual call)
for udp, no traffic is actually sent until the socket is written to.
So the remote server has no idea that somebody wants to talk to it.

On the other hand tcp's "connect" equivalent won't return until the
three way handshake is done thus telling the remote server that
somebody is talking to it.

Please note that I haven't done socket programming in well over a
decade, so I may have the particulars wrong but the idea is right
IIRC.

>I've written some tests which check the incoming parameters and uses  
>nc to setup a test to read the sending data. I can't find a way to  
>test the expected data, so any ideas appreciated. Tests should pass  
>on for this plugin now, which keeps me happy.

Doesn't something like

   echo "test" | nc -u -p 3333 -l

   check_udp -s '' -e test -p 3333 -H localhost

work? You need to send the empty packet to provoke a response.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.




More information about the Devel mailing list