Moderator Edit: This thread has been split from another - https://support.nagios.com/forum/viewto ... 16&t=47336
In the future, please create a new thread and link to the old one instead of adding on.
npolovenko,
I have tried that and it doesn't seem to be supported for Services event handlers. Only thing that seem to work is custom defined MACRO. My goals is to write a event handler that is generic to all host and use the pre-defined contact for that host. I don't want to go to each host and create custom MACRO for each services and each contact again.
Passing contact macro to external script
Re: Passing contact macro to external script
Contact macros are, unfortunately, not available to Service and Host event handlers:
https://assets.nagios.com/downloads/nag ... olist.html
But you could probably leverage parts of the Nagios XI REST API to get that information loaded into your event handler. You'd just need to code it yourself. More info regarding the REST API can be found in the "Help" section of the Nagios XI GUI.
If you were to configure this as a Global Event Handler using the Nagios XI component, your script could accept a host_name or service_description and use that information to evaluate the appropriate contacts by leveraging the REST API.
https://assets.nagios.com/downloads/nag ... olist.html
But you could probably leverage parts of the Nagios XI REST API to get that information loaded into your event handler. You'd just need to code it yourself. More info regarding the REST API can be found in the "Help" section of the Nagios XI GUI.
If you were to configure this as a Global Event Handler using the Nagios XI component, your script could accept a host_name or service_description and use that information to evaluate the appropriate contacts by leveraging the REST API.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/