Check OpenBGPD sessions Nagios|Icinga|shinken|etc plugin
Project description
==========================================================
Check OpenBGPD Nagios|Icinga|shinken|etc plugin.
==========================================================
.. image:: https://pypip.in/license/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/egg/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/status/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/implementation/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/py_versions/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/version/checkopenbgpd/badge.svg?text=version
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://api.travis-ci.org/jpcw/checkopenbgpd.svg?branch=master
:target: http://travis-ci.org/jpcw/checkopenbgpd
.. image:: https://coveralls.io/repos/jpcw/checkopenbgpd/badge.png?branch=master
:target: https://coveralls.io/r/jpcw/checkopenbgpd
+ Source: https://github.com/jpcw/checkopenbgpd
+ Bugtracker: https://github.com/jpcw/checkopenbgpd/issues
.. contents::
usage
-------
This check runs bgpctl show and check that all bgp sessions are up.
sample outputs :
+ Ok
::
$ check_openbgpd
CHECKBGPCTL OK - PEER-1 is 0 | '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 - PEER-2 is 0 | '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 None (outside range 0:) | 'PEER-1'=529918;;;0 'OTHER-PEER'=None;;;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
Install
------------
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
Nagios|icinga like configuration
-----------------------------------
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!
}
testing
---------
::
python bootstrap-buildout.py
bin/buildout -N
bin/test
Changelog
=========
0.2 (2015-04-09)
----------------
- Nothing changed yet.
0.1 (2015-04-09)
----------------
- Jean-Philippe Camguilhem <jp.camguilhem__at__gmail.com>
Contributors
==============
Jean-Philippe Camguilhem, Author
Check OpenBGPD Nagios|Icinga|shinken|etc plugin.
==========================================================
.. image:: https://pypip.in/license/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/egg/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/status/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/implementation/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/py_versions/checkopenbgpd/badge.svg
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://pypip.in/version/checkopenbgpd/badge.svg?text=version
:target: https://pypi-hypernode.com/pypi/checkopenbgpd/
.. image:: https://api.travis-ci.org/jpcw/checkopenbgpd.svg?branch=master
:target: http://travis-ci.org/jpcw/checkopenbgpd
.. image:: https://coveralls.io/repos/jpcw/checkopenbgpd/badge.png?branch=master
:target: https://coveralls.io/r/jpcw/checkopenbgpd
+ Source: https://github.com/jpcw/checkopenbgpd
+ Bugtracker: https://github.com/jpcw/checkopenbgpd/issues
.. contents::
usage
-------
This check runs bgpctl show and check that all bgp sessions are up.
sample outputs :
+ Ok
::
$ check_openbgpd
CHECKBGPCTL OK - PEER-1 is 0 | '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 - PEER-2 is 0 | '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 None (outside range 0:) | 'PEER-1'=529918;;;0 'OTHER-PEER'=None;;;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
Install
------------
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
Nagios|icinga like configuration
-----------------------------------
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!
}
testing
---------
::
python bootstrap-buildout.py
bin/buildout -N
bin/test
Changelog
=========
0.2 (2015-04-09)
----------------
- Nothing changed yet.
0.1 (2015-04-09)
----------------
- Jean-Philippe Camguilhem <jp.camguilhem__at__gmail.com>
Contributors
==============
Jean-Philippe Camguilhem, Author
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
checkopenbgpd-0.2.zip
(14.3 kB
view details)
File details
Details for the file checkopenbgpd-0.2.zip
.
File metadata
- Download URL: checkopenbgpd-0.2.zip
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10034e33e3ae6f81d6ad2554d64a08380f1b4216d8d6f49e9d1b11529f9aeace |
|
MD5 | 3857b25780ed58f02f600c23a67cb81f |
|
BLAKE2b-256 | a643cd1fb112f0cf8267a21f72a578e06274f91869c8fc4326fc2649f159fd65 |