As I understand it, the rules are to always over write the template, so
if you want the host to appear in cf-appservers as well as in
cf-servers, then you will need to put both in the hostgroup directive
in the host definition.  <br>
<br>
-Zac<br><br><div><span class="gmail_quote">On 12/29/05, <b class="gmail_sendername">Morten Werner Olsen</b> <<a href="mailto:werner@skolelinux.no">werner@skolelinux.no</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, Dec 29, 2005 at 09:00:25AM +0100, Morten Werner Olsen wrote:<br>> On Wed, Dec 28, 2005 at 06:54:31PM +0100, Andreas Ericsson wrote:<br>><br>> > The hostgroup still needs to be created. There doesn't have to be a
<br>> > "members" line, but there has to be hosts in the hostgroup. You can thus<br>> > create a config such as this<br>> ><br>> > define hostgroup{<br>> >     hostgroup_name  hostgrp
<br>> >     alias           Alias for hostgrp<br>> > }<br>> ><br>> > define host {<br>> >     use        the_template_that_includes_everything<br>> >     host_name  the_host<br>> >     hostgroups hostgrp
<br>> > }<br>><br>> This works for me now after upgrading to 2.0rc1 (I believe it didn't<br>> in 2.0b4), and that is great! :) But this resulted in another problem<br>> with defining the hostgroups in template-hosts only:
<br>><br>> # cf template host (based on another global template)<br>> define host {<br>>        use            linux-host<br>>        name          
linux-host-cf<br>>        hostgroups     cf-servers<br>>        contact_groups cf-core<br>>        register              
0<br>> }<br>><br>> # cf-servers - host group definition<br>> define hostgroup {<br>>        hostgroup_name cf-servers<br>>        alias          cf-servers<br>> }<br>><br>> # cf-app1 - application server #1
<br>> define host {<br>>        
use            
linux-host-cf<br>>         host_name       cf-app1<br>>         alias           cf-app1<br>>       hostgroups      cf-appservers<br>>         address         <a href="http://10.0.0.21">10.0.0.21</a><br>> }
<br>><br>> [a lot of hosts]<br>><br>> # diffhost - last host based on linux-host-cf template<br>> define host {<br>>        
use            
linux-host-cf<br>>         host_name       diffhost<br>>         alias           diffhost<br>>         address         <a href="http://10.0.0.43">10.0.0.43</a><br>> }<br>><br>> The wierd thing is that diffhost is the only host showing up
<br>> (webinterface) in the cf-servers hostgroup, and I also get warnings<br>> during the configtest about the other hosts having no services<br>> associated with them (I specify a ping-service to the cf-servers<br>
> hostgroup).<br><br>Just noticed that diffhost is the only host not having a hostgroups<br>definition, so I believe this is not so wierd afterall, but just the<br>hostgroups definition from the template that is overridden for
<br>cf-app1? I would like to see this work out with adding hostgroups both<br>in the templates and in the host definition, but it is probably<br>breaking the basic rules for templating in Nagios?<br><br><br>- Werner<br><br>
<br>-------------------------------------------------------<br>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files<br>for problems?  Stop!  Download the new AJAX search engine that makes<br>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<br><a href="http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click">http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click</a><br>_______________________________________________<br>Nagios-devel mailing list
<br><a href="mailto:Nagios-devel@lists.sourceforge.net">Nagios-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-devel">https://lists.sourceforge.net/lists/listinfo/nagios-devel
</a><br></blockquote></div><br>