[Nagiosplug-devel] [ nagiosplug-Bugs-1181554 ] 1.4-3: Bug incheck_tcp

Thomas Guyot-Sionnest Thomas at zango.com
Tue May 29 16:31:46 CEST 2007


> -----Original Message-----
> From: nagiosplug-devel-bounces at lists.sourceforge.net [mailto:nagiosplug-
> devel-bounces at lists.sourceforge.net] On Behalf Of SourceForge.net
> Sent: May 29, 2007 3:29
> To: noreply at sourceforge.net
> Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-1181554 ] 1.4-3: Bug
> incheck_tcp
> 
> Bugs item #1181554, was opened at 2005-04-12 17:27
> Message generated for change (Comment added) made by psychotrahe
> You can respond by visiting:
> https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1181554&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: None
> Group: None
> Status: Open
> Resolution: None
> Priority: 5
> Private: No
> Submitted By: Simon Bellwood (sb-netman)
> >Assigned to: Matthias Eble (psychotrahe)
> Summary: 1.4-3: Bug in check_tcp
> 
> Initial Comment:
> I'm using check_imap with perfparse, and it's returning
> critical for all values.
> 
> It seems the problem is that when no critical or
> warning value is passed to it on the command line, it
> defaults to use 0.000 and 0.000 respectively. Perfparse
> then sees that the check time (say 0.002 seconds) is
> above 0 and flags a CRITICAL warning.
> 
> I've had a look at the code, and the return happens at
> check_tcp.c:389, where fperfdata is called.
> fperfdata is provided by utils.h which sets both types
> to a double, so I suspect it's not as simple as
> changing check_tcp.c to return nulls if the -w and -c
> flags aren't given :/

Hey guys,

I believe all we want to change is:

                printf("|%s",
                                fperfdata ("time", elapsed_time, "s",
                                TRUE, warning_time,
                                TRUE, critical_time,
                                TRUE, 0,
                                TRUE, socket_timeout)

To something like this:

                printf("|%s",
                                fperfdata ("time", elapsed_time, "s",
                                (warning_time > 0 ? TRUE : FALSE),
                                warning_time,
                                (critical_time > 0 ? TRUE : FALSE),
                                critical_time,
                                TRUE, 0,
                                TRUE, socket_timeout)

Basically don't tell fperfdata that there is a warn/crit parameter if
there's none.

This may need some tuning but I hope you get the idea. I don't have time
right now... Please assign the bug to me (dermoth) if you like and I'll get
it fixed and tested tonight :)

At the same time I could review all of them to make sure there's no other
plugins with optional thresholds that hard-code the parameter.

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3076 bytes
Desc: not available
URL: <http://nagios-plugins.org/archive/devel/attachments/20070529/2c52d988/attachment.bin>


More information about the Devel mailing list