version 1.11, 2024/06/09 23:34:58 |
version 1.13, 2024/06/10 00:09:20 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $AFresh1: check_openbgpd,v 1.10 2015/03/26 03:44:15 andrew Exp $ |
# $AFresh1: check_openbgpd,v 1.12 2024/06/09 23:02:37 afresh1 Exp $ |
######################################################################## |
######################################################################## |
# check_openbgpd *** A nagios check for OpenBSD bgpd |
# check_openbgpd *** A nagios check for OpenBSD bgpd |
# |
# |
|
|
my $NAGIOS_OUTPUT = 1; |
my $NAGIOS_OUTPUT = 1; |
|
|
my $LICENSE = <<'EOL'; |
my $LICENSE = <<'EOL'; |
Copyright (c) 2009-2015 Andrew Fresh <andrew@afresh1.com> |
Copyright (c) 2009-2024 Andrew Fresh <andrew@afresh1.com> |
Permission to use, copy, modify, and distribute this software for any |
Permission to use, copy, modify, and distribute this software for any |
purpose with or without fee is hereby granted, provided that the above |
purpose with or without fee is hereby granted, provided that the above |
copyright notice and this permission notice appear in all copies. |
copyright notice and this permission notice appear in all copies. |
|
|
} |
} |
push @cmd, 'show', 'summary'; |
push @cmd, 'show', 'summary'; |
|
|
#open my $fh, '<', 'output' # XXX |
#open my $fh, '<', 'output' or die $!; # XXX |
open my $fh, '-|', @cmd or die "Couldn't open bgpctl: $!\n"; |
open my $fh, '-|', @cmd or die "Couldn't open bgpctl: $!\n"; |
while (<$fh>) { |
while (<$fh>) { |
chomp; |
chomp; |