Controlling and accessing Nagios data programmatically

Nagios is a great open source monitoring solution. However, it is missing an API to retrieve information and status about the monitored hosts, and perform operations without manually going to the web interface.

Below are solutions that provide an API to access and control Nagios:

Nagios API

Web site: https://pypi.python.org/pypi/nagios-api/

Python based HTTP REST API server to retrieve information and control Nagios:

  • Get host and services status
  • Schedule or disable downtime for a host or service
  • Acknowledge or disacknowledge a host or service
  • Any many other commands

 

MK LiveStatus

Web site: https://mathias-kettner.de/checkmk_livestatus.html

Part of the MK suite of utilities. MK LiveStatus is a Nagios module written in C that uses Nagios Event Broker API and allows accessing Nagios live host and services status and information.

It provides an API server and accessing the data is done via SQL like commands.

Python modules to access Livestatus:

MK Livestatus. Get Nagios data with Python API.

https://github.com/ageric/livestatus/tree/master/api/python

 

Centreon-clapi

Documentation: https://documentation.centreon.com/docs/centreon-clapi/en/latest/overview.html

If you use Centreon with Nagios, you can use the centreon command line utility to control Nagios:

  • Manage and create host and services configurations (can automatically generate configuration and restart Nagios)
  • Create or cancel downtimes for hosts
  • Create or cancel acknowledgements for hosts or services
  • And more

 

PyNag

Web site: http://pynag.org

Python modules to manipulate and parse Nagios configurations.

Leave a Reply

Your email address will not be published. Required fields are marked *