{"id":15019140,"url":"https://github.com/jpcw/checkopenbgpd","last_synced_at":"2025-10-24T05:30:30.507Z","repository":{"id":28493271,"uuid":"32009565","full_name":"jpcw/checkopenbgpd","owner":"jpcw","description":"Check OpenBGPD sessions Nagios|Icinga|shinken|etc plugin","archived":false,"fork":false,"pushed_at":"2018-09-22T20:28:43.000Z","size":47,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T23:41:20.991Z","etag":null,"topics":["centreon","icinga-plugin","nagios","openbgpd","openbsd","python","shinken"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpcw.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-11T09:39:31.000Z","updated_at":"2024-06-10T00:23:36.000Z","dependencies_parsed_at":"2022-09-08T21:12:16.401Z","dependency_job_id":null,"html_url":"https://github.com/jpcw/checkopenbgpd","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcw%2Fcheckopenbgpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcw%2Fcheckopenbgpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcw%2Fcheckopenbgpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcw%2Fcheckopenbgpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpcw","download_url":"https://codeload.github.com/jpcw/checkopenbgpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237915423,"owners_count":19386724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centreon","icinga-plugin","nagios","openbgpd","openbsd","python","shinken"],"created_at":"2024-09-24T19:53:03.326Z","updated_at":"2025-10-24T05:30:30.180Z","avatar_url":"https://github.com/jpcw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n==========================================================\nCheck OpenBGPD Nagios|Icinga|shinken|etc plugin.\n==========================================================\n\n.. image:: https://img.shields.io/pypi/l/checkopenbgpd.svg\n    :target: https://pypi.python.org/pypi/checkopenbgpd/\n\n.. image:: https://img.shields.io/pypi/implementation/checkopenbgpd.svg\n    :target: https://pypi.python.org/pypi/checkopenbgpd/\n\n.. image:: https://img.shields.io/pypi/pyversions/checkopenbgpd.svg\n    :target: https://pypi.python.org/pypi/checkopenbgpd/\n\n.. image:: https://img.shields.io/pypi/v/checkopenbgpd.svg\n    :target: https://pypi.python.org/pypi/checkopenbgpd/\n\n.. image:: https://img.shields.io/pypi/status/checkopenbgpd.svg\n    :target: https://pypi.python.org/pypi/checkopenbgpd/\n\n.. image:: https://img.shields.io/pypi/wheel/checkopenbgpd.svg\n    :target: https://pypi.python.org/pypi/checkopenbgpd/\n\n.. image:: https://img.shields.io/coveralls/jpcw/checkopenbgpd.svg\n    :target: https://coveralls.io/r/jpcw/checkopenbgpd\n\n.. image:: https://api.travis-ci.org/jpcw/checkopenbgpd.svg?branch=master\n    :target: http://travis-ci.org/jpcw/checkopenbgpd\n\n\n+ Source: https://github.com/jpcw/checkopenbgpd\n\n+ Bugtracker: https://github.com/jpcw/checkopenbgpd/issues\n\n.. contents::\n\nusage\n-------\n\nThis check runs **bgpctl show** and checks that all bgp sessions are up.\n\n\nsample outputs :\n\n+ Ok\n\n::\n \n $ check_openbgpd \n CHECKBGPCTL OK - All bgp sessions in correct state | 'PEER-1'=529581;;;0 \n    \nSometimes 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.\n\n::\n \n  $ check_openbgpd --ignore-list PEER-2 OTHER-PEER\n  CHECKBGPCTL OK - All bgp sessions in correct state | 'PEER-1'=529581;;;0 'PEER-2'=0;;;0 'OTHER-PEER'=0;;;0\n\n\n\n+ Critical\n\nCritical state is reached with first ignore session not escaped in the optionnal '--ignore-list' \n \n::\n \n $ check_openbgpd\n CHECKBGPCTL CRITICAL - OTHER-PEER is U (outside range 0:) | 'PEER-1'=529918;;;0 'OTHER-PEER'=U;;;0\n\n\n+ Unknown\n\nif an error occured during the check, the plugin raises a check error, which returns an UNKNOWN state.\n\ntypically UNKNOWN causes\n\n + OpenBGPD is not running \n\n ::\n   \n  CHECKBGPCTL UNKNOWN - host.domain.tld bgpctl: connect: /var/run/bgpd.sock: No such file or directory\n\n + you're not in the wheel group, and can't read the bgpctl sosk \n\n ::\n   \n  CHECKBGPCTL UNKNOWN - host.domain.tld bgpctl: connect: /var/run/bgpd.sock: Permission denied \n\n doas is your friend to run this plugin with an unprivileged user. A sample config here \n\n ::\n  \n  permit nopass icinga as root cmd /usr/local/bin/check_openbgpd\n\n\nInstall\n------------\n\nextract the tarball and :: \n\n    python setup.py install\n\nMaybe you have installed setuptools with ::\n\n    pkg_add py-setuptools\n\nthen just ::\n    \n    easy_install checkopenbgpd\n\ncheck_openbgpd is located at /usr/local/bin/check_openbgpd\n\n\nNagios|icinga like configuration\n-----------------------------------\n\ncheck_openbgpd could be called localy or remotely via check_by_ssh or NRPE.\n\n**check_by_ssh**\n\nhere a sample definition to check remotely by ssh \n\nCommand definition ::\n    \n    define command{\n        command_name    check_ssh_bgpctl\n        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$\"\n    }\n\nthe service itself ::\n    \n    define service{\n        use                     my-service\n        host_name               hostname\n        service_description     bgpctl\n        check_command           check_ssh_bgpctl!\n    }\n\nicinga2 command ::\n    \n\tobject CheckCommand \"openbgpd\" {\n        import \"plugin-check-command\"\n        import \"ipv4-or-ipv6\"\n        command = [ PluginDir + \"/check_by_ssh\" ]\n        arguments = {\n            \"-H\" = \"$openbgpd_address$\"\n            \"-i\" = \"$ssh_id$\"\n            \"-p\" = \"$ssh_port$\"\n            \"-C\" = \"$ssh_command$\"\n    \t    }\n        vars.openbgpd_address = \"$check_address$\"\n        vars.ssh_id = \"/var/spool/icinga/.ssh/id_rsa\"\n        vars.ssh_port = \"$vars.ssh_port$\"\n        vars.ssh_command = \"sudo /usr/local/bin/check_openbgpd\"\n\t}\n\nicinga2 service ::\n\t\n\tapply Service \"openbgpd\" {\n  \t    check_command = \"openbgpd\"\n  \t    assign where host.name == \"hostname\"\n\t}\n\n**NRPE**\n\nadd this line to /usr/local/etc/nrpe.cfg ::\n     \n    ...\n    command[check_openbgpd]=/usr/local/bin/check_openbgpd\n    ...\n\nnagios command definition ::\n    \n    define command{\n        command_name    check_nrpe_bgpctl\n        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_openbgpd -a \"--ignore-list $ARGS1\"\n    }\n\nthe service itself ::\n    \n    define service{\n        use                     my-service\n        host_name               hostname\n        service_description     bgpctl\n        check_command           check_nrpe_bgpctl!\n    }   \n\ntesting\n---------\n::\n     \n     python bootstrap-buildout.py --setuptools-version=33.1.1 --buildout-version=2.5.2\n     bin/buildout -N\n     bin/test\n     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcw%2Fcheckopenbgpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpcw%2Fcheckopenbgpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcw%2Fcheckopenbgpd/lists"}