Pluggin - Exit code always 1
Mark Snyder
Mark.Snyder at worldgaming.com
Tue Sep 23 15:49:48 CEST 2003
I am not sure what is meant by "cast to integers".
If you could please explain.
Setting the exit code to exit 0; does not work either.
I modified the code to print out the value of "$ERRORS{$result}".
Below is the test output and the relevant part of the code.
Test Output:
./check_ssp -w 30 -c 33; echo $?
0 - OK - E10K Temperature at: 26.1 (Waring:30 Critical:33)
1
./check_ssp -w 20 -c 33; echo $?
1 - WARNING - E10K Temperature at: 26.1 (Waring:20 Critical:33)
1
./check_ssp -w 20 -c 23; echo $?
2 - CRITICAL - E10K Temperature at: 26.1 (Waring:20 Critical:23)
1
Relevant Code
$result = 'OK';
if ($temp > $warning) {
$result = 'WARNING';
}
if ($temp > $critical) {
$result = 'CRITICAL';
}
print "$ERRORS{$result} - $result - E10K Temperature at: $temp (Waring:$warning Critical:$critical)\n";
exit $ERRORS{$result};
-----Original Message-----
From: Karl DeBisschop [mailto:karl at debisschop.net]
In perl, when the words WARNING and CRITICAL are cast to integers, 1 is
the result.
--
Karl
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list