[Nagiosplug-devel] check_ssh and check_smtp return codes
Ben Whaley
bwhaley at costrack.com
Wed Jan 28 09:10:18 CET 2004
Greetings all,
I didn't want to submit this as a bug report yet, God knows I've been wrong
before..
Most mornings when I get to work I see errors on the console that say:
Segmentation Fault - core dumped
Warning: Return code of 139 for check of service 'SSH Check' on host
'ucsub' was out of bounds.
Sometimes this error is for SMTP checks instead of ssh checks. Anyway,
examining the code has led me to a couple of possibilities.
check_ssh and check_smtp open a tcp connection in the same way:
result = my_tcp_connect (...);
The result is then examined for STATE_OK, otherwise both check_ssh and
check_smtp 'return result'. After looking into what my_tcp_connect can
return (from netutils.c), it looks as though it can only return
STATE_UNKNOWN, STATE_CRITICAL, and STATE_OK. I see nothing that would make
it return 139. However, when I changed the 'return result' (when result !=
STATE_OK after calling my_tcp_connect) to 'return UNKNOWN', the problem
disappeared. This indicates that it may be a bug in netutils.c.
The relevant lines are ~99 in check_smtp.c and ~197 in check_ssh.c.
The other possibility is on the Nagios end. I briefly checked into that and,
if it is a Nagios problem, it would be in checks.c. I didn't spend a lot of
time digging there.
I hope this makes at least some sense.
Regards,
Ben Whaley
More information about the Devel
mailing list