Package: checkopenbgpd
Source:https://github.com/jpcw/checkopenbgpdBugtracker:https://github.com/jpcw/checkopenbgpd/issuesContentsusageInstallNagios|icinga like configurationtestingChangelog0.10 (2018-01-20)0.9 (2017-03-07)0.8 (2016-04-15)0.7 (2015-04-12)0.6 (2015-04-09)0.50.1 (2015-04-09)ContributorsusageThis check runsbgpctl showand checks that all bgp sessions are up.sample outputs :Ok$ check_openbgpd
CHECKBGPCTL OK - All bgp sessions in correct state | 'PEER-1'=529581;;;0Sometimes you have some peer sessions in ignore state, and it ‘s not critical. Typically a session which depends on a slave carp interface. You have an option ‘–ignore-list’, the plugin will take care if the session is in this list, and returns an ‘OK’ state for this session.$ check_openbgpd --ignore-list PEER-2 OTHER-PEER
CHECKBGPCTL OK - All bgp sessions in correct state | 'PEER-1'=529581;;;0 'PEER-2'=0;;;0 'OTHER-PEER'=0;;;0CriticalCritical state is reached with first ignore session not escaped in the optionnal ‘–ignore-list’$ check_openbgpd
CHECKBGPCTL CRITICAL - OTHER-PEER is U (outside range 0:) | 'PEER-1'=529918;;;0 'OTHER-PEER'=U;;;0Unknownif an error occured during the check, the plugin raises a check error, which returns an UNKNOWN state.typically UNKNOWN causesOpenBGPD is not runningCHECKBGPCTL UNKNOWN - host.domain.tld bgpctl: connect: /var/run/bgpd.sock: No such file or directoryyou’re not in the wheel group, and can’t read the bgpctl soskCHECKBGPCTL UNKNOWN - host.domain.tld bgpctl: connect: /var/run/bgpd.sock: Permission denieddoas is your friend to run this plugin with an unprivileged user. A sample config herepermit nopass icinga as root cmd /usr/local/bin/check_openbgpdInstallextract the tarball andpython setup.py installMaybe you have installed setuptools withpkg_add py-setuptoolsthen justeasy_install checkopenbgpdcheck_openbgpd is located at /usr/local/bin/check_openbgpdNagios|icinga like configurationcheck_openbgpd could be called localy or remotely via check_by_ssh or NRPE.check_by_sshhere a sample definition to check remotely by sshCommand definitiondefine command{
    command_name    check_ssh_bgpctl
    command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -i /var/spool/icinga/.ssh/id_rsa -C "sudo /usr/local/bin/check_openbgpd --ignore-list $ARG1$"
}the service itselfdefine service{
    use                     my-service
    host_name               hostname
    service_description     bgpctl
    check_command           check_ssh_bgpctl!
}icinga2 commandobject CheckCommand "openbgpd" {
import "plugin-check-command"
import "ipv4-or-ipv6"
command = [ PluginDir + "/check_by_ssh" ]
arguments = {
    "-H" = "$openbgpd_address$"
    "-i" = "$ssh_id$"
    "-p" = "$ssh_port$"
    "-C" = "$ssh_command$"
    }
vars.openbgpd_address = "$check_address$"
vars.ssh_id = "/var/spool/icinga/.ssh/id_rsa"
vars.ssh_port = "$vars.ssh_port$"
vars.ssh_command = "sudo /usr/local/bin/check_openbgpd"
}icinga2 serviceapply Service "openbgpd" {
    check_command = "openbgpd"
    assign where host.name == "hostname"
}NRPEadd this line to /usr/local/etc/nrpe.cfg...
command[check_openbgpd]=/usr/local/bin/check_openbgpd
...nagios command definitiondefine command{
    command_name    check_nrpe_bgpctl
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_openbgpd -a "--ignore-list $ARGS1"
}the service itselfdefine service{
    use                     my-service
    host_name               hostname
    service_description     bgpctl
    check_command           check_nrpe_bgpctl!
}testingpython bootstrap-buildout.py --setuptools-version=33.1.1 --buildout-version=2.5.2
bin/buildout -N
bin/testChangelog0.10 (2018-01-20)replace –idle-list with a more permissive –ignore-listhttps://github.com/jpcw/checkopenbgpd/issues/5fix broken Python3https://github.com/jpcw/checkopenbgpd/issues/40.9 (2017-03-07)fix session with max-prefixhttps://github.com/jpcw/checkopenbgpd/issues/3thanks drustan for bug reportthanks Dam64 which up a session with max-prefix for tests and debug0.8 (2016-04-15)python3.5 support0.7 (2015-04-12)fix ‘idle’ breaks performance data renderinghttps://github.com/jpcw/checkopenbgpd/issues/10.6 (2015-04-09)improve summary0.5Fix Cosmetics on README0.1 (2015-04-09)Jean-Philippe Camguilhem <jpcw__at__camguilhem.net>ContributorsJean-Philippe Camguilhem, Author