Skip Menu |

This queue is for tickets about the Nagios-Plugin CPAN distribution.

Report information
The Basics
Id: 21198
Status: resolved
Priority: 0/
Queue: Nagios-Plugin

People
Owner: Nobody in particular
Requestors: carlos.velasco [...] nimastelecom.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Plugin always return UNKNOWN instead of OK
Date: Sun, 27 Aug 2006 08:30:55 +0200
To: bug-Nagios-Plugin [...] rt.cpan.org
From: Carlos Velasco <carlos.velasco [...] nimastelecom.com>
A plugin always return UNKNOWN when it should return OK. plugin->die( return_code => 0, message => 'any' ); Returns: UNKNOWN The problem is in Base.pm, die function The line reads: -my $return_code = $args->{return_code} || 3; So, 0 || 3 == 3. This check was intended for undefined values, so this should be the right code: +my $return_code = defined($args->{return_code})?$args->{return_code}:3;
Subject: Re: [rt.cpan.org #21198] AutoReply: Plugin always return UNKNOWN instead of OK
Date: Sun, 27 Aug 2006 08:57:27 +0200
To: bug-Nagios-Plugin [...] rt.cpan.org
From: Carlos Velasco <carlos.velasco [...] nimastelecom.com>
Well... it seems there is another problem related to this. sub get_status, in Threshold.pm, has return values for CRITICAL and WARNING ranges... but not for OK, or default... A return value is needed at the end of sub get_status: +return $ERRORS{OK};
Carlos, Thanks for the report. This has been fixed. N::P 0.14 has just been released to CPAN. Ton