Nagios 5.6.14 - On the notifications being sent, is there an easy way to add the hostgroup to the notifications. We are moving to having a central group for the alerts notification and they need to know what type of OS the alert is for so they can contact the correct group for resolution.
I reviewed the Understanding Notification Variables document and to not see any reference to Hostgroups.
Add Hostgroup to Notifications
Re: Add Hostgroup to Notifications
$HOSTGROUPNAME$ AND $HOSTGROUPNAMES$ are available and can be added to notifications:
https://assets.nagios.com/downloads/nag ... olist.html
Edit the xi_hostnotification_handler to add $HOSTGROUPNAMES$:
A list of the hostgroups will then be stored in %hostgroups% which can be used in the notification message.
https://assets.nagios.com/downloads/nag ... olist.html
Edit the xi_hostnotification_handler to add $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$" --hostgroups="$HOSTGROUPNAMES$"As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Add Hostgroup to Notifications
Thank you for the information. This post can be closed.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Add Hostgroup to Notifications
Greatbrucej543 wrote:Thank you for the information. This post can be closed.
Closing thread