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;