Patrick, you legend, it worked! Thanks a bunch...<br><br><div class="gmail_quote">On Fri, Jul 10, 2009 at 12:44 AM, Morris, Patrick <span dir="ltr"><<a href="mailto:patrick.morris@hp.com">patrick.morris@hp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Guy!<br>
<div><div></div><div class="h5"><br>
On Tue, 07 Jul 2009, Guy Waugh wrote:<br>
<br>
> Hi all,<br>
><br>
> I'm trying to configure nagios 3.0.6 so that I can add contact groups to a host by adding a host template to the host definition.<br>
><br>
> I have one host template called 'unix-host' that I'm using to aggregate the Unix Team contacts into a template. I have another host template called 'oncall-host' that I'm using to represent people on call 24x7. If a host is critical enough that the on-call people should be alerted if it goes down, I want to be able to add the 'oncall-host' host template as a template for the critical host, have the 'unix-host' host template as another template for the host, and have nagios alert both the people on call and the Unix Team admins if the host goes down. The on-call people should be alerted by SMS and email every 5 minutes, but the Unix Team admins are should only be alerted by email every 10 minutes.<br>
><br>
> I have an email server called 'doris' that is currently down, and is configured as specified below. What's happening is that the on-call people are being alerted by SMS and email every 10 minutes (which is as it should be), but the Unix Team admins aren't being alerted at all. If I remove the 'oncall-host' template from the host definition, the Unix Team admins are alerted by email as they should be.<br>
><br>
> Can anyone suggest how I might get the alerting working, and still be able to just add the 'oncall-host' template as a template for a critical host? Perhaps it would be better to do this with hostgroups?<br>
><br>
> Here are all my definitions... sorry if it's a bit convoluted:<br>
><br>
> Here's the host definition for the host in question:<br>
> define host {<br>
> host_name doris<br>
> alias doris email server<br>
> address 192.168.2.25<br>
> parents sw-l3-mail<br>
> use oncall-host,unix-host<br>
> register 1<br>
> }<br>
><br>
> 'unix-host' host template:<br>
> define host {<br>
> name unix-host<br>
> alias Unix Team host template<br>
> use generic-host<br>
> contact_groups +unix-admin<br>
> register 0<br>
> }<br>
><br>
> 'oncall-host' host template:<br>
> define host {<br>
> name oncall-host<br>
> alias Host template for critical hosts<br>
> use generic-host<br>
> contact_groups oncall-primary<br>
> notification_interval 5<br>
> register 0<br>
> }<br>
<br>
</div></div>Adding a "+" before "oncall-primary" in oncall-host to specify that it<br>
should be added to the list of contacts, rather than to replace it<br>
completely, should give you what you want.<br>
</blockquote></div><br>