From 170e6f36b2fdc0ed1528ecc2e37fbf1bfa2323f5 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 Nov 2019 16:29:48 +0200 Subject: [PATCH] Add BGP sessions check --- monitoring/icinga2/conf.d/commands-new.conf | 10 ++++++++++ monitoring/icinga2/conf.d/hosts/router-vin.conf | 3 +++ monitoring/icinga2/conf.d/services-new.conf | 13 +++++++++++++ 3 files changed, 26 insertions(+) diff --git a/monitoring/icinga2/conf.d/commands-new.conf b/monitoring/icinga2/conf.d/commands-new.conf index f974a04..9432f12 100644 --- a/monitoring/icinga2/conf.d/commands-new.conf +++ b/monitoring/icinga2/conf.d/commands-new.conf @@ -83,3 +83,13 @@ object CheckCommand "rtmp-check" { vars.monitoreduri = "" vars.timeout = 10 } + +######################################################################################## +# Router services +######################################################################################## +object CheckCommand "bgp_sessions_check" { + import "plugin-check-command" + command = PluginDir + "/check_bird_bgp --asn $ASN$ --ebgp --sessions_down_ok $sessions_down$" + vars.ASN = "" + vars.sessions_down = "" +} diff --git a/monitoring/icinga2/conf.d/hosts/router-vin.conf b/monitoring/icinga2/conf.d/hosts/router-vin.conf index c1454ef..2302247 100644 --- a/monitoring/icinga2/conf.d/hosts/router-vin.conf +++ b/monitoring/icinga2/conf.d/hosts/router-vin.conf @@ -13,6 +13,9 @@ object Host "vin-external.openfest.org" { vars.open_ports = "80 179 2004 53 22 7002 8443 443" + vars.ASN = "65500" + vars.sessions_down = "" + vars.notification["slack"] = { groups = [ "icingaadmins" ] } diff --git a/monitoring/icinga2/conf.d/services-new.conf b/monitoring/icinga2/conf.d/services-new.conf index 602841b..4589133 100644 --- a/monitoring/icinga2/conf.d/services-new.conf +++ b/monitoring/icinga2/conf.d/services-new.conf @@ -86,3 +86,16 @@ apply Service for (stream => config in host.vars.rtmp_check) { ### assign where host.name == "vin-external.openfest.org" assign where host.vars.rtmp_check } + +apply Service "bird_bgp_sessions" { + import "generic-service" + max_check_attempts = 3 + check_interval = 5m + retry_interval = 1m + check_command = "bgp_sessions_check" + vars.ASN = host.vars.ASN + vars.sessions_down = host.vars.sessions_down + assign where host.vars.ASN + + vars.notif_prio = "high" +}