I'm looking to show the HOSTGROUP in all notifications as configured in the Admin-->Notification Management screen.
In reading http://assets.nagios.com/downloads/nagi ... iables.pdf, I don't see a variable for HOSTGROUP or SERVICEGROUP.
This would be tremendously helpful to our operations center in knowing what groups alerts belong to. We have different SLAs for different systems, as I'm sure other shops do.
Any ideas?
-Andrew
hostgroup variable for notifications?
hostgroup variable for notifications?
Andrew J. - Do you even grok?
Re: hostgroup variable for notifications?
You can actually use just about any core macro with the notification component. First, add the macro assignment you want ( $HOSTGROUPNAMES$ in this example ) to the notification command in the CCM. Go to --> Configure --> Core Configuration Manager --> Commands --> Click "xi_host_notification_handler" --> Add the following line to end of the command:
So the check resembles (your command may be slightly different, but it should contain the added macro assignment:
Now edit the notification "Host Alert Message" in the notification component. Add the following to the message:
A full list of object type specific macros can be found below:
http://nagios.sourceforge.net/docs/3_0/macrolist.html
Code: Select all
--hostgroupnames="$HOSTGROUPNAMES$"Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$" --hostgroupnames="$HOSTGROUPNAMES$"Code: Select all
Hostgroups: %hostgroupnames%http://nagios.sourceforge.net/docs/3_0/macrolist.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: hostgroup variable for notifications?
Tested successfully with both host and service notifications!
I'll follow the same lines to get the Notes URL passed in notifications as well. Sending a link to the wiki for our various environments will be even better.
Thanks Andy!
I'll follow the same lines to get the Notes URL passed in notifications as well. Sending a link to the wiki for our various environments will be even better.
Thanks Andy!
Andrew J. - Do you even grok?