How to setup notifications for hostgroups responsible teams

Hello there,

I have multiple hostgroups like “Linux VM”, “Linux-Physical”, “Solaris VM”, “Solaris Physical”, “Windows VM” and “Windows Physical”. I have created a user for UNIX/Linux hostgroup notifications and other for Windows hostgroups notifications, I want the UNIX/Linux hostgroup notifications to be sent only to UNIX/Linux user and Windows hostgroups notifications to be sent only to Windows user, but for some reason it is sending notifications to both the users.

Could someone please help me with correct configuration?

Attached the configs screen shots.

Thank & regards,
Balaji.

hosts-conf-Linux hosts-conf-windows

Hello @sbakumar,
I hope you are well. Notification are getting sent to both apply rules because of the assign rule. You have “assign where host.vars.notification.mail” in your assign statement for both notification objects. This mean if ANY user is set for host.vars.notification.mail variable then this apply rule is TRUE.

You should change the assign statement around to look at the host.vars.os variable. See below.

apply Notification "mail-UNIX Team" to Host {
...
assign where host.vars.os == "Linux VM"
}

This will send notification to the “UNIX Team” for all host with the “Linux VM” variable set in the host object.

I hope this helps. Regards
Alex

Hello Alex,

Thanks a lot. It worked.

Thanks & regards,
Balaji.