Re: [Nagios-devel] Nagios implied and additive inheritance;

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Nagios implied and additive inheritance;

Post by Guest »

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 wi=
th the
> host and any service on the host.
> 2) Occasionally, we'd like other contact_groups to be notified about pr=
oblems
> with certain services on the host.
>=20
> If I'm understanding the documentation at
> http://nagios.sourceforge.net/docs/nagi ... itance.ht=
ml
> 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 (=3D bad), anyway, so I never even tried to write a patch.

Regards,
J. Bern
--=20
Jochen Bern, Systemingenieur --- LINworks GmbH
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP =3D D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C2=
7
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Gesch=E4ftsf=FChrer Metin Dogan, Oliver Mic=
hel





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked