version 1.8, 2009/11/09 18:11:33 |
version 1.9, 2009/11/09 20:22:43 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: check_bioctl,v 1.7 2009/11/09 18:00:09 andrew Exp $ |
# $RedRiver: check_bioctl,v 1.8 2009/11/09 18:11:33 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_bioctl *** A nagios check for OpenBSD bioctl |
# check_bioctl *** A nagios check for OpenBSD bioctl |
# |
# |
# 2006.07.26 #*#*# andrew fresh <andrew@mad-techies.org> |
# 2006.07.26 #*#*# andrew fresh <andrew@afresh1.com> |
######################################################################## |
######################################################################## |
use strict; |
use strict; |
use warnings; |
use warnings; |
|
|
|
|
use constant NAGIOS_OUTPUT => 1; |
use constant NAGIOS_OUTPUT => 1; |
|
|
|
my $License = <<'EOL'; |
|
Copyright (c) 2009 Andrew Fresh <andrew@afresh1.com> |
|
Permission to use, copy, modify, and distribute this software for any |
|
purpose with or without fee is hereby granted, provided that the above |
|
copyright notice and this permission notice appear in all copies. |
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
EOL |
|
|
use POSIX; |
use POSIX; |
use lib "/usr/local/libexec/nagios"; |
use lib "/usr/local/libexec/nagios"; |
use utils qw($TIMEOUT %ERRORS &print_revision &support); |
use utils qw($TIMEOUT %ERRORS &support); |
|
|
use Getopt::Long; |
use Getopt::Long; |
Getopt::Long::Configure('bundling'); |
Getopt::Long::Configure('bundling'); |
|
|
exit $ERRORS{$state}; |
exit $ERRORS{$state}; |
|
|
sub print_help { |
sub print_help { |
print <<EOL; |
print <<"EOL"; |
$PROGNAME plugin for Nagios monitors bioctl on OpenBSD |
$PROGNAME plugin for Nagios monitors bioctl on OpenBSD |
$PROGNAME -d <device> [ -d <device2> [ -d ... ] ] |
$PROGNAME -d <device> [ -d <device2> [ -d ... ] ] |
|
|
|
|
EOL |
EOL |
|
|
print_revision( $PROGNAME, '$Revision$' ); |
print_revision( $PROGNAME, '$Revision$' ); |
|
|
|
print $License; |
} |
} |
|
|
|
|
|
sub print_revision { |
|
my ($prog, $rev) = @_; |
|
$rev =~ s/^\D+([\d\.]+)\D+$/v$1/xms; |
|
|
|
print "$prog $rev\n"; |
|
} |