Nagios implied and additive inheritance; possible bug?

Jochen Bern Jochen.Bern at LINworks.de
Wed Mar 28 19:46:42 CEST 2012


On 03/28/2012 06:44 PM, Jim Winkle wrote:
> I'd like to set up Nagios contact_groups in the following way (but it's not
> working as expected):
> 1) In general, contact_groups for a host are notified about problems with the
> host and any service on the host.
> 2) Occasionally, we'd like other contact_groups to be notified about problems
> with certain services on the host.
> 
> If I'm understanding the documentation at
> http://nagios.sourceforge.net/docs/nagioscore/3/en/objectinheritance.html
> correctly (I'm running (3.3.1), it indicates that #1 can be done using implied
> inheritance and #2 by using additive inheritance, but it's not working as
> expected.

I tried that myself a while back, and dug into the (3.2.x) code when it
didn't work for me, either. (I'll assume that the relevant code is still
the same in 3.3.1.) The fact of the matter is that in
xdata/xodtemplate.c:xodtemplate_read_config_data(), you have calls - in
this order - to

1. xodtemplate_resolve_objects(), which calls
   xodtemplate_resolve_service() on all service objects, which applies
   all templates, using xodtemplate_get_inherited_string() *IFF* both
   service and template have the corresponding config setting, which
   does the additive inheritance,

2. xodtemplate_clean_additive_strings(), which silently removes any
   surviving "+" from contacts and contact groups settings of all
   objects except host and service escalations, and

3. xodtemplate_inherit_object_properties(), which does the host-to-
   service inheritance.

They're not sitting *next* to each other, though - in particular, most
of the "recombombulation" stuff intervenes between 2. and 3. - and
turning things around would introduce a behavioral change for identical
configs (= bad), anyway, so I never even tried to write a patch.

Regards,
								J. Bern
-- 
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure




More information about the Developers mailing list