New webservice to manage monitoring downtimes with Livestatus

To follow my previous post about distributed monitoring, I had to update my script to manage nagios’ downtimes. I explained my first method in a previous article.
I completly rewrote the webservice in python using Livestatus. The sources are available on my github.
This script supports multiples Livestatus daemons.
The use of this webservice is quite similar to the old one. You need to query an HTTP GET with multiples arguments.
The query format is the following:

ACTION=(schedule-svc-downtime|remove-svc-downtime|schedule-servicegroup-downtime)&MANDATORY_ARGUMENTS

The MANDATORY_ARGUMENTS depends on the ACTION:

  • If ACTION=schedule-svc-downtime: mandatory arguments are HOSTNAME,SERVICEDESC,DURATION,AUTHOR,COMMENT
  • If ACTION=remove-svc-downtime: mandatory arguments are HOSTNAME,SERVICEDESC
  • If ACTION=schedule-servicegroup-downtime : mandatory arguments are SERVICEGROUP,DURATION,AUTHOR,COMMENT

With :

  • HOSTNAME the host_name defined in nagios
  • SERVICEDESC the service_description defined in nagios
  • DURATION the duration in seconds
  • SERVICEGROUP the servicegroups defined in nagios
  • AUTHOR the contact in nagios

The advantages of this new script are:

  • Support of managing multiple monitoring servers from a single end-point
  • You don’t need to run that script on the monitoring server
  • This script is compatible with any monitoring server that have a Livestatus broker. It has been tested with Shinken and Nagios.

If you have any feedback, don’t hesitate to post a comment!

Share
  1. How do I use the above script? Where do I drop it?

Leave a Comment