Hey folks, anyone here have more information how to configure the Event Handler using CheckMK Raw?
I found some links about it but still have some questions:
- The /etc/nagios/conf.d is the correct place to add the file? And the events configuration need to be created inside the CheckMK server installation with the name event_handler.cfg?
- Is that a way to test if the configuration it’s working?
- This example bellow is a good way to how to configure the file?
extra_service_conf["event_handler_enabled"] = [
( "1", ["Linux"], ["Service Name"] ),
]
extra_service_conf["event_handler"] = [
( "manage_service", ["Linux"], ["Service Name"]),
]
extra_nagios_conf += r"""
define command{
command_name manage_service
command_line /usr/local/bin/manage_service.sh $SERVICESTATE$ $SERVICESTATETYPE$ $HOSTADDRESS$
}
"""
To give more context, the ideia is pretty simple, when CheckMK identify that the service are in a CRITICAL state, will run the script to restart the service.
Here the links that I found for future reference:
https://www.geekbundle.org/selbstheilung-mit-check_mk-event-handler/