Giter Club home page Giter Club logo

checkopenbgpd's Introduction

Check OpenBGPD Nagios|Icinga|shinken|etc plugin.

https://api.travis-ci.org/jpcw/checkopenbgpd.svg?branch=master

This check runs bgpctl show and checks that all bgp sessions are up.

sample outputs :

  • Ok
$ check_openbgpd
CHECKBGPCTL OK - All bgp sessions in correct state | 'PEER-1'=529581;;;0

Sometimes you have some peer sessions in idle state, and it 's not critical. Typically a session which depends on a slave carp interface. You have an option '--idle-list', the plugin will take care if the session is in this list, and returns an 'OK' state for this session.

$ check_openbgpd --idle-list PEER-2 OTHER-PEER
CHECKBGPCTL OK - All bgp sessions in correct state | 'PEER-1'=529581;;;0 'PEER-2'=0;;;0 'OTHER-PEER'=0;;;0
  • Critical

Critical state is reached with first idle session not escaped in the optionnal '--idle-list'

$ check_openbgpd
CHECKBGPCTL CRITICAL - OTHER-PEER is U (outside range 0:) | 'PEER-1'=529918;;;0 'OTHER-PEER'=U;;;0
  • Unknown

if an error occured during the check, the plugin raises a check error, which returns an UNKNOWN state.

typically UNKNOWN causes

  • OpenBGPD is not running
CHECKBGPCTL UNKNOWN - host.domain.tld bgpctl: connect: /var/run/bgpd.sock: No such file or directory
  • you're not in the wheel group, and can't read the bgpctl sosk
CHECKBGPCTL UNKNOWN - host.domain.tld bgpctl: connect: /var/run/bgpd.sock: Permission denied

sudo is your friend to run this plugin with an unprivileged user. A sample config here
icinga ALL = NOPASSWD: /usr/local/bin/check_openbgpd

extract the tarball and

python setup.py install

Maybe you have installed setuptools with

pkg_add py-setuptools

then just

easy_install checkopenbgpd

check_openbgpd is located at /usr/local/bin/check_openbgpd

check_openbgpd could be called localy or remotely via check_by_ssh or NRPE.

check_by_ssh

here a sample definition to check remotely by ssh

Command definition

define 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 --idle-list $ARG1$"
}

the service itself

define service{
    use                     my-service
    host_name               hostname
    service_description     bgpctl
    check_command           check_ssh_bgpctl!
}

NRPE

add this line to /usr/local/etc/nrpe.cfg

...
command[check_openbgpd]=/usr/local/bin/check_openbgpd
...

nagios command definition

define command{
    command_name    check_nrpe_bgpctl
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_openbgpd -a "--crit-list $ARGS1"
}

the service itself

define service{
    use                     my-service
    host_name               hostname
    service_description     bgpctl
    check_command           check_nrpe_bgpctl!
}
python bootstrap-buildout.py
bin/buildout -N
bin/test

checkopenbgpd's People

Contributors

jpcw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.