[Nagiosplug-devel] [ nagiosplug-Bugs-822662 ] check_tcp does not return "TCP CRITICAL"

SourceForge.net noreply at sourceforge.net
Fri May 5 01:46:05 CEST 2006


Bugs item #822662, was opened at 2003-10-13 12:00
Message generated for change (Settings changed) made by tonvoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=822662&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parsing problem
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Hugo Monteiro (hvm_pt)
>Assigned to: Ton Voon (tonvoon)
Summary: check_tcp does not return "TCP CRITICAL"

Initial Comment:
check_tcp plugin should return a "TCP CRITICAL:
Connection refused by host" when the tcp service port
checked is down.

example: "check_tcp server1 -p 3128" (SQUID Port)

If the squid service is down we get a "Connection
refused by host" but we should get a "TCP CRITICAL:
etc.." since this service is down.

Because of this, Nagios puts this service in the
critical services group, but we can't get any
availability report because services checked by this
plugin (using check_tcp xxx -p xxxx) are not returning
valid exit codes/echoes: "TCP OK", "TCP WARNING" or
"TCP CRITICAL".

This service check not even appear has unknown!?!!

----------------------------------------------------------------------

Comment By: Chris Funderburg (funderburg)
Date: 2005-05-19 13:54

Message:
Logged In: YES 
user_id=10827

This still appears to not work even in CVS code.  Is Nagios
not being maintained anymore ?

----------------------------------------------------------------------

Comment By: Jeremy T. Bouse (undrgrid)
Date: 2003-10-13 17:23

Message:
Logged In: YES 
user_id=10485

I believe if you check the contents of
nagios-10-10-2003-00.log thru nagios-10-10-2003-23.log you
would find that all the entries are for the same day but the
logs have been truncated because they grew to be too long...
What you need to do when doing reports is to tell it that it
can go back through more logs by setting the "Backtracked
Archives" to higher than the default (which for me is 2)... 

----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2003-10-13 16:48

Message:
Logged In: YES 
user_id=664364

I had a problem with extra nagios logs being created (with -
23). It turned out to be an NTP problem on the server I was 
using. See http://www.nagios.org/faqs/viewfaq.php?
faq_id=93 for the resolution.

----------------------------------------------------------------------

Comment By: Hugo Monteiro (hvm_pt)
Date: 2003-10-13 16:37

Message:
Logged In: YES 
user_id=12156

Additional notes:
The exit code seems to be valid to NAGIOS process, it can
process it well. The problem was that something broke the
archived LOG, it appeared "nagios-10-10-2003-23.log" (notice
the -23) instead of "nagios-10-10-2003-00.log". That was why
this services didn't appear in the Availability Report. (I'm
still searching what caused this.)

Besides this, i've added the following lines to 'netutils.c'
starting line 309:
-- cut here --
                printf ("CONNECTION CRITICAL: ");
--- end cut ---
So, if we cannot make a connection it will print something
like CONNECTION CRITICAL: "+"Error message from the
'switch/case on the line below"'
example: "CONNECTION CRITICAL: Connection refused by host."

PS: Check all information i sent and see if this really is
an check_tcp plugin issue, and something needs to be
modified, or if this bug report can be closed.

----------------------------------------------------------------------

Comment By: Jeremy T. Bouse (undrgrid)
Date: 2003-10-13 14:28

Message:
Logged In: YES 
user_id=10485

As I've done quite a few changes in the current CVS HEAD
version of the check_tcp code I believe I know where this
problem lies. It seems to be in the actual connection code
and not in the processing of the reply as it never gets the
connection socket to open. I'll look into it and see if this
is possible to preface with "TCP CRITICAL" however the code
to my knowledge DOES return the proper exit code it is just
the human readable details that is failing to display.

----------------------------------------------------------------------

Comment By: Hugo Monteiro (hvm_pt)
Date: 2003-10-13 12:46

Message:
Logged In: YES 
user_id=12156

The problem seems to be in "netutils.c" file between line
308 and 320.
Even if this errors are not known, a plugin should always
return a known error (OK, WARNING, CRITICAL or UNKNOWN) if
it sends anything besides this, it will break Nagios service
information (reports, stats, etc.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=822662&group_id=29880




More information about the Devel mailing list