[Nagiosplug-devel] check_udp

Andreas Ericsson ae at op5.se
Fri Mar 24 12:04:02 CET 2006


Ton Voon wrote:
> 
> 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!


Perhaps so, unless you're sending this data into some program that's 
logging invalid requests, in which case you'll quickly make check_udp a 
nuissance on the receiving end of those packets.


> That works really well now - t/check_udp.t now does  
> tests for sending and receiving of packets. Just committed into CVS.
> 

ArrrggghhH! Why, oh why?? Try it with a closed or filtered port. On FC4 
they all return OK, so the tests are borked.

(just to be a nuissance, "I told you so". Sean did too. UDP is fire and 
forget, so unless the send(2) or sendto(2) fails, this will return OK 
every time).


> I seem to need to kill nc for the sending test. If I'm doing  something 
> wrong with nc, let me know.
> 

You need to either upgrade your nc so it recognizes non-terminal input 
or send it an EOF.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231




More information about the Devel mailing list