Page 1 of 1

Notification Message question

Posted: Tue Apr 29, 2014 11:09 am
by povachon
Hi there
I would like to add the hostgroup membership of a host in the notification message.
Is there anyway to do so?
Regard
PO

Re: Notification Message question

Posted: Tue Apr 29, 2014 12:20 pm
by tmcdonald
Absolutely! Have you looked at our macro list? $HOSTGROUPALIAS$ should be what you are looking for.

Re: Notification Message question

Posted: Thu May 01, 2014 8:57 am
by povachon
Not sure if im doing the write thing but it not working. Here the result of the notification :
_______________________________________________________________________________
***** Nagios XI Alert *****



Notification Type: CUSTOM
Host: ABUS_VPN-1
State: DOWN
Address: 10.50.20.1
Info: CRITICAL - 10.50.20.1: rta nan, lost 100%
Date/Time: 2014-05-01 09:38:43
Host Group Membership : $HOSTGROUPNAMES$

Respond: http://10.10.20.10/nagiosxi//rr.php?uid ... 174ebea7aa
Nagios URL: http://10.10.20.10/nagiosxi/
________________________________________________________________________________________

As you can see the the macro seem not to trigger the output ! It should list the hostgroup that belong this host in this case ABUS_VPN-1
Can you help me with that plz.
Regard
PO

Re: Notification Message question

Posted: Thu May 01, 2014 9:29 am
by tmcdonald
Where did you make that edit? Are you changing the notification command in the CCM or are you clicking Notification Messages after clicking your name? The $$ macros will only work in the first case and the edit must be made there.

Re: Notification Message question

Posted: Thu May 01, 2014 9:52 am
by povachon
Here where i make the change is that the right place to do so?

Regard
PO

Re: Notification Message question

Posted: Thu May 01, 2014 10:15 am
by abrist
You need to first edit the command for the notification. Go to Configure --> Core Config Manager --> Commands. Edit "xi_host_notification_handler". Add the following to the end of the command:

Code: Select all

--hostgroupnames="$HOSTGROUPNAMES$"
Save and apply configuration.

Now edit the notification message to include the following (instead of $HOSTGROUPNAMES$):

Code: Select all

Host Group Membership: %hostgroupnames%
Save the changes. It should now be configured.
More information can be found in the following doc:
http://assets.nagios.com/downloads/nagi ... iables.pdf

Re: Notification Message question

Posted: Thu May 01, 2014 11:50 am
by povachon
You rock man! you can lock this thread !
Many thx
PO