Hostgroup name variable

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rdembski
Posts: 1
Joined: Tue May 26, 2020 5:47 pm

Hostgroup name variable

Post by rdembski »

Is there a notifications variable for the name of a hostgroup? I've tried searching, but found nothing besides a variable list that's over 4 years old.

Nagios XI version: 5.6.8


Thanks in advance.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Hostgroup name variable

Post by cdienger »

Were you referring to https://assets.nagios.com/downloads/nag ... olist.html ? That list contains:

https://assets.nagios.com/downloads/nag ... tgroupname
https://assets.nagios.com/downloads/nag ... groupnames

Neither of these are variables in the notification commands, but that can be changed. See https://assets.nagios.com/downloads/nag ... iables.pdf. And for example you could modify the xi_host_notification_handler command to look like:

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$" --hostduration="$HOSTDURATION$" --hostgroups "$HOSTGROUPNAMES$"
and then "%hostgroups% could be used in a notification.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked