Passing contact macro to external script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
johnwchen
Posts: 2
Joined: Thu Feb 11, 2016 8:55 am

Passing contact macro to external script

Post by johnwchen »

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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Passing contact macro to external script

Post by mcapra »

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.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Passing contact macro to external script

Post by kyang »

Thanks for the help @mcapra!

johnwchen, Let us know if you have any more questions!
Locked