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?
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 configuration that I’m using today (All files in CheckMK server):
Files created after login with omd user: sudo su - site_name etc/check_mk/main.mk
# Main configuration file of Check_MK
# We highly recommend to use WATO to configure Check_MK these days.
extra_service_conf["event_handler_enabled"]=["1", ALL_HOSTS, ALL_SERVICES]
extra_service_conf["event_handler"]=["call_script", ALL_HOSTS, ALL_SERVICES]
Local modifications to ~/etc/check_mk/main.mk are stored in separate files in ~/etc/check_mk/conf.d. These files will presumably not be changed during a CMK update. That is why the alert handler settings are stored in this directory.
Folder for action scripts: /opt/omd/sites/[site]/local/lib/nagios/plugins/
Logfile for alert handler: /opt/omd/sites/[site]/var/log/eventhandler.log
Activate changes to alert_handlers.mk inside the CMK instance with:
Hey @gerald.endres, thanks for the tips, so my CheckMK installation don’t have a file called alert_handlers.mk, I will create it.
Do you have a example of the content for this file?
I’ve tried with this simple example here but the log file was not created: