Modified openbgpd check to be in NRPE critical state when BGPD is not running
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Jérémy Dubois 2020-07-08 17:28:12 +02:00
parent 3dd9e461c4
commit 30c1b70e2b

View file

@ -5,6 +5,18 @@
# #
# 2009.11.12 #*#*# andrew fresh <andrew@afresh1.com> # 2009.11.12 #*#*# andrew fresh <andrew@afresh1.com>
######################################################################## ########################################################################
#
# MODIFIED VERSION FOR THE NEEDS OF EVOLIX
# By Jérémy Dubois <jdubois@evolix.fr>
#
# Line 51 :
# added « open STDERR, '>&STDOUT'; »
#
# Lines 123 to 126 :
# added « or exit 2; »
# commented « or die $! » and the 2 lines below
#
########################################################################
use strict; use strict;
use warnings; use warnings;
@ -36,6 +48,7 @@ my $BGPCTL = '/usr/sbin/bgpctl';
use POSIX; use POSIX;
use Config; use Config;
my $PREFIX; my $PREFIX;
open STDERR, '>&STDOUT';
BEGIN { BEGIN {
## no critic 'warnings' ## no critic 'warnings'
@ -107,9 +120,10 @@ sub read_status {
} }
## no critic 'die' ## no critic 'die'
close $fh close $fh
or die $! or exit 2;
? "Error closing sysctl pipe: $!\n" # or die $!
: "Exit status $? from sysctl\n"; # ? "Error closing sysctl pipe: $!\n"
# : "Exit status $? from sysctl\n";
return grep { exists $_->{neighbor} && $_->{as} ne 'AS' } @S; return grep { exists $_->{neighbor} && $_->{as} ne 'AS' } @S;
} }