version 1.9, 2015/03/26 04:42:23 |
version 1.10, 2015/03/26 04:44:15 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $AFresh1: check_openbgpd,v 1.8 2015/03/25 02:20:06 andrew Exp $ |
# $AFresh1: check_openbgpd,v 1.9 2015/03/26 03:42:23 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_openbgpd *** A nagios check for OpenBSD bgpd |
# check_openbgpd *** A nagios check for OpenBSD bgpd |
# |
# |
|
|
when (/^-?-c(?:ritical)?/xms) { $c = parse_check( shift @argv ) } |
when (/^-?-c(?:ritical)?/xms) { $c = parse_check( shift @argv ) } |
when (/^-?-u(?:nknown)?/xms) { |
when (/^-?-u(?:nknown)?/xms) { |
$checks{_UNKNOWN} = { |
$checks{_UNKNOWN} = { |
WARNING => $w, |
WARNING => $w, |
CRITICAL => $c, |
CRITICAL => $c, |
} |
}; |
} |
} |
when (/^-?-n(?:eighbor)?/xms) { |
when (/^-?-n(?:eighbor)?/xms) { |
while ( @argv && $argv[0] !~ /^-/xms ) { |
while ( @argv && $argv[0] !~ /^-/xms ) { |
$checks{ shift @argv } = { |
$checks{ shift @argv } = { |
WARNING => $w, |
WARNING => $w, |
CRITICAL => $c, |
CRITICAL => $c, |
} |
}; |
} |
} |
} |
} |
default { print_help(); exit $ERRORS{'UNKNOWN'} } |
default { print_help(); exit $ERRORS{'UNKNOWN'} } |