Include hostgroup in the Email Alert

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Include hostgroup in the Email Alert

Post by haile711 »

Hey Guys,

Is there a way to include the hostgroup in the email group? Reason being we have 1000+ hosts and they are belong to different applications and the naming convention for the host does not tell me which application is having an issue. But we did define these hosts to hostgroup(application group), so it is possible to include the hostgroup in the email alert so we know which application it is coming from?

This is the default notify command we use

Code: Select all

/usr/bin/printf "%b" "***** Nagios XI Monitoring*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nHostgroup: $HOSTGROUPALIAS$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail -s $USER7$ -t $CONTACTEMAIL$ -cc "$USER10$" -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ MCOM_RTP Host Alert: $HOSTNAME$ **" -m "***** Nagios XI Monitoring *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"
Thanks..
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Include hostgroup in the Email Alert

Post by rkennedy »

It looks like you're already passing $HOSTGROUPALIAS$, is this not sufficing?

The only macros I'm seeing are the following for hostgroups (https://assets.nagios.com/downloads/nag ... olist.html) -

Code: Select all

$HOSTGROUPALIAS$ 								
$HOSTGROUPMEMBERS$ 								
$HOSTGROUPNOTES$ 								
$HOSTGROUPNOTESURL$ 								
$HOSTGROUPACTIONURL$ 					
If none of those will work, then you can file a feature request for it here - https://github.com/NagiosEnterprises/nagioscore/issues - if you don't have a GitHub account, let me know and I'll file it on your behalf.
Former Nagios Employee
haile711
Posts: 197
Joined: Thu May 28, 2015 7:36 am

Re: Include hostgroup in the Email Alert

Post by haile711 »

Kennedy,

even though it's already part of the notify command but when i received the email, it's not in there
***** Nagios XI Monitoring *****

Notification Type: PROBLEM

Service: Dashboard_Data_Layer
Host: Dynatrace:Dashboard
Address: 10.72.42.20
State: CRITICAL

Date/Time: Thu Nov 17 11:01:39 EST 2016

Additional Info:

CRITICAL: No data found for bcom_apollo_kws_s, bcom_msp_tax_a, bcom_apollo_sns_p, bcom_apollo_sns_s on 10.72.42.20
Sure can you submit it for me? since I do not have a github account

Thanks
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Include hostgroup in the Email Alert

Post by avandemore »

Github accounts are free, you can sign there if you like. We can submit a FR for this on your behalf but it's unlikely to gain any traction.

Hostgroups aren't designed to be used in that manner as that functionality is provided elsewhere.

https://assets.nagios.com/downloads/nag ... #hostgroup
https://assets.nagios.com/downloads/nag ... ntactgroup

The intended method for you get this functionality is to create a contact group including all the contacts you want in the host group. Then create a template referencing the contact group. Any host you want can use the template or be overridden at the host level.

https://assets.nagios.com/downloads/nag ... tance.html
Previous Nagios employee
Locked