Page 1 of 1

Passing Host Group via XI SNMP Trap Sender

Posted: Tue Feb 03, 2015 8:16 am
by JakeHatMacys
In regards to this old topic: http://support.nagios.com/forum/viewtop ... 16&t=31152

I have a quick question, what is the correct variable to get host group name into the PHP?

One of our coders is going to take a stab at getting it to work.

Thanks.

Re: Passing Host Group via XI SNMP Trap Sender

Posted: Tue Feb 03, 2015 11:21 am
by scottwilkerson
You would need to modify in the CCM the command

Code: Select all

xi_host_event_handler
and you can add something like the following to the end of the command

Code: Select all

 --hostgroupnames=$HOSTGROUPNAMES$
this would add the hostgroupnames to the event_meta array, and it could be accessed with %hostgroupnames% in the command.

You can do the same with any of the macros that are available to even handlers
http://nagios.sourceforge.net/docs/nagi ... olist.html


For services you would need to make similar changes to the following command

Code: Select all

xi_service_event_handler