=================================================================== RCS file: /cvs/nagios/check_bioctl/check_bioctl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- nagios/check_bioctl/check_bioctl 2009/11/09 18:00:09 1.7 +++ nagios/check_bioctl/check_bioctl 2009/11/09 18:11:33 1.8 @@ -1,13 +1,10 @@ #!/usr/bin/perl -T -# $RedRiver: check_bioctl,v 1.6 2009/11/09 17:58:29 andrew Exp $ +# $RedRiver: check_bioctl,v 1.7 2009/11/09 18:00:09 andrew Exp $ ######################################################################## # check_bioctl *** A nagios check for OpenBSD bioctl # # 2006.07.26 #*#*# andrew fresh ######################################################################## -# TODO: -# Really need real documentation. -######################################################################## use strict; use warnings; @@ -58,7 +55,7 @@ } if ($opt_V) { - print_revision( $PROGNAME, '$Revision: 1.7 $ ' ); + print_revision( $PROGNAME, '$Revision: 1.8 $ ' ); exit $ERRORS{'OK'}; } @@ -69,7 +66,7 @@ my %VOLUMES; foreach my $device (@devices) { - open my $bioctl, "-|", $BIOCTL, $device or die "Couldn't open bioctl: $!"; + open my $bioctl, '-|', $BIOCTL, $device or die "Couldn't open bioctl: $!"; my $volume_id; while (<$bioctl>) { @@ -141,6 +138,7 @@ } my $have_results = 0; +$state = 'OK'; foreach my $error ( sort { $ERRORS{$b} <=> $ERRORS{$a} } keys %ERRORS ) { if ( exists $states{$error} ) { $have_results++; @@ -148,7 +146,7 @@ if (NAGIOS_OUTPUT) { print "$error (" . scalar( @{ $states{$error} } ) . ")"; - unless ( $error eq 'OK' ) { + if ( $error ne 'OK' ) { print '
'; print map {" - $_
"} @{ $states{$error} }; } @@ -177,6 +175,6 @@ EOL - print_revision( $PROGNAME, '$Revision: 1.7 $' ); + print_revision( $PROGNAME, '$Revision: 1.8 $' ); }