Possible to override contacts for just one Nagios host group?
Solution 1:
The problem is, that when I add
contact_groups sandradebug
it is still onlyadmins
that gets the notification and not alsosandradebug
.
Have you restarted the Nagios? Your above configuration will override the template values and only sandradebug
group will receive these alerts.
How can I include
sandradebug
for this one host, so notifications are also sent there?
Object Inheritance is what you are looking for:
define host {
use linux-host
host_name example
alias example
address 10.10.10.10
hostgroups default-linux-services
contact_groups +sandradebug
}
Using the +
sign, the host definition uses the data in the template and adds the sandradebug
to the alerts.
Solution 2:
For this, I would just combine the template with the definition since you're only using it once:
define host {
use generic-host
host_name example
alias example
address 10.10.10.10
hostgroups default-linux-services
check_command check-host-alive
notification_interval 4320
notification_options d,u,r
contact_groups sandradebug,admins
}
What's likely happening is that your template is overriding the contact group specified.