[Nagiosplug-devel] check_tcp patch

Matthew Kent mkent at magoazul.com
Thu Dec 9 08:17:05 CET 2004


On Thu, 2004-12-09 at 13:31, Ollie Cook wrote:
> Hi,
> 
> check_tcp in 1.4.0alpha2 uses strstr(3) to determine whether or not the
> expected string appears in the server's output.
> 
> Using check_nntp this causes unexpected behaviour under Diablo. For example
> if I use:
> 
>   check_nntp -H $HOSTADDRESS$
> 
> I get a false positive because the server's output might be:
> 
>   502 obfuscated.hostname: Transfer permission - newmaster at domain.com (DIABLO 5-CUR-20031207-02)
> 
> check_nntp is expecting a response of "200" or "201" and it's getting it (from
> the Diablo version timestamp).
> 
> I've attached a short patch which checks for the expected string at the start
> of the server's output. It also prints out what the response was in the error
> message which will help people in debugging why their checks are failing.
> 

Thank you for the patch. I'll take a look at it this evening. For future
bug fixes, can you submit them to the sourceforge tracker
(http://sourceforge.net/projects/nagiosplug/) ? Currently this is the
preferred way to keep track of these requests.

> I realise that this is a change of behaviour the people might not expect if
> they're used to the match happening anywhere in a line. In that case, might I
> suggest this be added as another option (e.g. -E ?)
> 
> Furthermore I've changed the state from warning to critical because I think not
> getting the output you expect from a service is very serious. Do others agree?
> Perhaps this also ought to be configurable?
> 

It's serious, but at least with WARNING you can know that service is up,
just not functioning correctly. I think this would be best suited to a
new flag to let people force critical when an invalid response is
received.

Thoughts?

> Cheers,
> 
> Ollie





More information about the Devel mailing list