version 1.9, 2009/11/09 20:22:43 |
version 1.10, 2009/11/12 18:54:38 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: check_bioctl,v 1.8 2009/11/09 18:11:33 andrew Exp $ |
# $RedRiver: check_bioctl,v 1.9 2009/11/09 20:22:43 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_bioctl *** A nagios check for OpenBSD bioctl |
# check_bioctl *** A nagios check for OpenBSD bioctl |
# |
# |
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
EOL |
EOL |
|
|
|
my $PROGNAME = "check_bioctl"; |
|
my $BIOCTL = '/sbin/bioctl'; |
|
|
use POSIX; |
use POSIX; |
use lib "/usr/local/libexec/nagios"; |
my $PREFIX; |
|
BEGIN { |
|
## no critic 'warnings' |
|
no warnings 'uninitialized'; |
|
$PREFIX = "${PREFIX}" || '/usr/local'; # Magic for OpenBSD ports tree |
|
} |
|
use lib $PREFIX . '/libexec/nagios'; |
use utils qw($TIMEOUT %ERRORS &support); |
use utils qw($TIMEOUT %ERRORS &support); |
|
|
|
$SIG{'ALRM'} = sub { |
|
print ("ERROR: $PROGNAME timeout\n"); |
|
exit $ERRORS{'UNKNOWN'}; |
|
}; |
|
alarm($TIMEOUT); |
|
|
use Getopt::Long; |
use Getopt::Long; |
Getopt::Long::Configure('bundling'); |
Getopt::Long::Configure('bundling'); |
|
|
my $PROGNAME = "check_bioctl"; |
|
my $BIOCTL = '/sbin/bioctl'; |
|
|
|
# This maps the status we get from bioctl to something nagios can use |
# This maps the status we get from bioctl to something nagios can use |
my %Status_Map = ( |
my %Status_Map = ( |