Turning off specific Icinga 2 notifications over HTTP

icingamonitoringscripting

In Nagios Core, it is possible to turn off notifications for a specific service or host through the web interface. This is a simple web request, which we can also construct in a command line script/tool.

This CGI connector is ideal in cases where we need to turn off notifications for hosts that are being manually rebooted, where services are being updated or code redeployed by automated scripts, and so on.

Recently we've been looking into moving to Icinga 2. From its web interface (aptly named Icinga Web), it is possible to do the same thing. There is just one problem; since Icinga has CSRF mitigation, it is not possible to do this in a straightforward manner by emulating Icinga Web requests.

Is there a way of doing this via some sort of API (REST or otherwise)? So far my searches have turned up nothing other than the specifications for the old CGI interface, which doesn't seem to be available on the new Icinga Web, reference: http://docs.icinga.org/latest/en/extcommands2.html

EDIT: After actually reading the provided link carefully, I noticed this provides us with a command file, allowing command insertion as a line-based medium. This still presents us with some problems though (concurrency being one of them).

Best Answer

Apparently Icinga2 has a feature called "Livestatus" which allows the user to send extcommands (http://docs.icinga.org/latest/en/extcommands2.html) through a TCP connection. All you need to do is prefix the command with COMMAND.

Related Topic