=================================================================== RCS file: /cvs/nagios/check_pf_limits/check_pf_limits,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- nagios/check_pf_limits/check_pf_limits 2010/01/14 22:42:12 1.3 +++ nagios/check_pf_limits/check_pf_limits 2010/01/14 22:57:15 1.4 @@ -1,5 +1,5 @@ #!/usr/bin/perl -T -# $AFresh1: check_pf_limits,v 1.2 2010/01/14 22:37:40 andrew Exp $ +# $AFresh1: check_pf_limits,v 1.3 2010/01/14 22:42:12 andrew Exp $ ######################################################################## # check_openbgpd *** A nagios check for OpenBSD bgpd # @@ -29,7 +29,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. EOL -our ($VERSION) = '$Revision: 1.3 $' =~ m{ \$Revision: \s+ (\S+) }xms; +our ($VERSION) = '$Revision: 1.4 $' =~ m{ \$Revision: \s+ (\S+) }xms; my $PROGNAME = 'check_pf_limits'; my $PFCTL = '/sbin/pfctl'; @@ -250,6 +250,15 @@ ); my %states; + my $status = $S->{info}{Status}; + if (0 == index $status, 'Enabled') { + push @{ $states{OK} }, $status; + } + else { + push @{ $states{CRITICAL} }, $status; + } + + my %matched; STATE: foreach my $k ( keys %known_limits ) { $matched{$k} = 1; @@ -348,7 +357,7 @@ my $opt = shift @argv; given ($opt) { when ( '-V' || '--version' ) { - print_revision( $PROGNAME, '$Revision: 1.3 $ ' ); + print_revision( $PROGNAME, '$Revision: 1.4 $ ' ); exit $ERRORS{'OK'} } when (/^-?-h(?:elp)?/xms) { print_help(); exit $ERRORS{'OK'} } @@ -418,6 +427,8 @@ Any known limits that are unspecified are checked with the last specified warning and criticical ENTRY. +Also checks if pf is enabled and is CRITICAL if not. + Example: $PROGNAME -c :90% -l src-nodes -w 10:75% -l states @@ -430,7 +441,7 @@ EOL - print_revision( $PROGNAME, '$Revision: 1.3 $' ); + print_revision( $PROGNAME, '$Revision: 1.4 $' ); print $LICENSE;