[Nagiosplug-devel] check_udp

John P. Rouillard rouilj at cs.umb.edu
Fri Mar 24 12:08:08 CET 2006


In message <129FE073-1B41-4845-A1DC-07847B5E1E86 at altinity.com>,
Ton Voon writes:
>On 24 Mar 2006, at 15:45, John P. Rouillard wrote:
>
>> 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.
>
>You're brilliant! That works really well now - t/check_udp.t now does  
>tests for sending and receiving of packets. Just committed into CVS.
>
>I seem to need to kill nc for the sending test. If I'm doing  
>something wrong with nc, let me know.

Not quite sure what you are running, but as long as nc has stdin open
in udp mode it will stay up. I think:

  nc -u -p 3333 -l < /dev/null

should allow a connect, spit out what it received then exit since stdin
is closed.

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




More information about the Devel mailing list