Object Definitions with Multiple Templates

Mathew Walker lmw94002 at hotmail.com
Wed Sep 23 18:26:49 CEST 2009


make sure you have hostgroup definitions setup ...

 

define hostgroup{
        hostgroup_name  DUMMY2
        alias           Dummy2 Servers
}

 

Also NOTE in my test host, I have the line:

use   dummy-hosts1,dummy-hosts2 

 

Each defines group DUMMY1 and DUMMY2 respectively...

 

after restarting Nagios, the host is only a member of the DUMMY2 group.

 

definining options like this the inheritance "overrides" settings with the values of the subsquent templates listed.  so the group of the last template listed is the one used.

-- 
Mat W. - http://www.techadre.com


 
> Date: Wed, 23 Sep 2009 11:05:11 -0400
> From: jtata at gpworldwide.com
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Object Definitions with Multiple Templates
> 
> I am having a problem getting Nagios to accept multiple templates in
> object definitions. 
> 
> Here is an example. I have two templates defined in templates.cfg: 
> 
> 
> define host {
> use host #This is my "generic" template with
> all my basic options in it
> name prod-host
> hostgroups prod_servers #Production server host
> group
> notification_period 24x7
> register 0
> }
> 
> 
> define host {
> use host
> name win-host
> hostgroups win_servers #Windows server host group
> register 0
> }
> 
> Defining an object with either of these templates works fine. However
> what I really need to do is: 
> 
> define host {
> use prod-host,win-host 
> name windows-server
> address 192.1.1.1
> alias My Windows Production Server
> }
> 
> Instead when I run nagios -v I get:
> 
> "Error: Template 'prod-host,win-host' specified in host definition could
> not be not found" etc.
> 
> http://nagios.sourceforge.net/docs/3_0/objectinheritance.html indicates
> this should be possible, and that the resulting object should have
> properties of both hosts, but something isn't working. Am I not
> defining something correctly or is this possibly a bug/documentation
> error?
> 
> Thanks
> 
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
 		 	   		  
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090923/de374db4/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list