Skip to content

Commit

Permalink
Fixed incorrect return values in Nagios plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Vicente committed Sep 29, 2011
1 parent c62bfd2 commit 351bc8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
12 changes: 7 additions & 5 deletions bin/check_bgppeer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# Report bugs to: cvicente(at)ns.uoregon.edu
#
# 08/05/2009 Version 1.1
# 09/29/2011 Version 1.2 - Fixed incorrect return values
#

use SNMP;
Expand All @@ -36,11 +37,12 @@
my $TIMEOUT = 30;
my %self;

my %ERRORS = ('UNKNOWN' => '-1',
'OK' => '0',
'WARNING' => '1',
'CRITICAL' => '2');

my %ERRORS = (
'OK' => 0,
'WARNING' => 1,
'CRITICAL' => 2,
'UNKNOWN' => 3,
);

my %PEERSTATE = (1 => "idle",
2 => "connect",
Expand Down
11 changes: 7 additions & 4 deletions bin/check_ifstatus.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
# Report bugs to: cvicente(at)ns.uoregon.edu
#
# 07/28/2009 Version 1.0
# 09/29/2011 Version 1.1 - Fixed incorrect return values
#

use SNMP;
use strict;
use Getopt::Long qw(:config no_ignore_case bundling);
my %ERRORS = ('UNKNOWN' => '-1',
'OK' => '0',
'WARNING' => '1',
'CRITICAL' => '2');
my %ERRORS = (
'OK' => 0,
'WARNING' => 1,
'CRITICAL' => 2,
'UNKNOWN' => 3,
);

my $state = 'UNKNOWN';
my %self;
Expand Down

0 comments on commit 351bc8b

Please sign in to comment.