Pluggin - Exit code always 1

Mark Snyder Mark.Snyder at worldgaming.com
Mon Sep 22 07:01:34 CEST 2003


Please help with this pluggin.  The exit code is always 1 but the  error message is correct.
I have include the test output and relevent parts of the code.


Test  commands and output

     ./check_ssp -w 30 -c 33; echo $?
     OK - E10K Temperature at: 26.1 (Waring:30 Critical:33)
     1

     ./check_ssp -w 20 -c 33; echo $?
     WARNING - E10K Temperature at: 26.1 (Waring:20 Critical:33)
     1

     [./check_ssp -w 20 -c 23; echo $?
     CRITICAL - E10K Temperature at: 26.1 (Waring:20 Critical:23)
     1

Included as suggested in Nagios plug-in development  guidlines

     use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);


Here is the code that determines the exit code

     $result = 'OK';

     if ($temp > $warning) {
             $result = 'WARNING';
     }
     if ($temp > $critical) {
             $result = 'CRITICAL';
     }

     print "$result - E10K Temperature at: $temp (Waring:$warning Critical:$critical)\n";
     exit $ERRORS{$result};


Mark Snyder



-------------------------------------------------------
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