Additive inheritance from multiple templates behavior

Gerd Radecke wi2009i at gmail.com
Tue Jan 29 17:08:51 CET 2013


Hi,

I'm currently experementing with inheritance from multiple templates (as it
is recommened at
http://nagios.sourceforge.net/docs/3_0/objectinheritance.html<http://docs.icinga.org/latest/en/objectinheritance.html#multipleinheritancesources>)
and I stumbled across a rather unexpected behavior.

My example configuration looks like this:

-----------
define host {
use             generic-host
name            tempTwo
hostgroups      +hg_two
contact_groups  +cg_two
register 0
}

define host {
use             generic-host
name            tempOne
hostgroups      +hg_one
contact_groups  +cg_one
register 0
}

define host {
use              tempOne,tempTwo
host_name        example
address          127.0.0.1
}
-------------------
I'm not getting any erros when parsing the config. However, the results are
odd:
1. My host "example" is now a member of two hostgroups: hg_one and hg_two.
That seemed logical to me as both templates only append another member to
the hostgroups list.
2. Yet, the host has only one contactgroup: cg_one.
3. If I change the use line in the example host to "use   tempTwo,
tempOne", the only notification group will be cg_two.
4. If I add yet another template (tempThree with analog hg_three and
cg_three) the result is as expected: all three hostgroups are applied but
only the first contactgroup.

Can someone explain to me why these two behaviors differ? I would think
that the behavior shown by the hostgroup is correct (and
http://www.mentby.com/Group/nagios-users/object-definitions-with-multiple-templates.htmlwould
support that). So is the behavior of the contact_group inheritance a
bug or did I miss something in the documentation?

Cheers,
Gerd Radecke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20130129/c3b30a21/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
-------------- 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