In the server we have several machines, but the event handler is to work when a certain group of machines goes into critical state in a given service.
I have never worked with event handlers and scripts but I have managed to do a barebone script. My question is how to handle the macros.
I was thinking of calling a Python script to the check if the hostname belongs to the list of hosts required, and to do some other operations, such as creating a JSON file.
Hi joaoe33,
thanks for the explanation.
When using the (paid) Entreprise Edition, you can use the Alert Handler for this purpose. But with the Raw Edition you can use the Event Handlers with standard configuration under ~/etc/nagios/conf.d/. See also the (short) doc here:
See also the other files there. The hostname shall be denoted as $HOSTNAME$ e.g…
“”"
And when I try to apply the changes by typing cmk -O I get the following error:
Generating configuration for core (type nagios)…OK
Validating Nagios configuration…ERROR:
An error occurred: not all arguments converted during string formatting
Apparently my issue was not with the definitions I passed to check mk. My issue was related with the OS installed and the python versions running. Everything is fixed and working.