Re: [Nagios-devel] Inheriting contact_name does not work (any more?)

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] Inheriting contact_name does not work (any more?)

Post by Guest »

Hi Matthias,

On 2 Jun 2009, at 23:18, Matthias Eble wrote:

> I wanted to use a similar config to this one:
>
> define contact{
> register 0
> use generic-contact
> name foobar-admin
> contact_name foobar
> }
>
> define contact{
> use foobar-admin
> pager +12345
> }
>
> to separate pager/mail addresses into another config file.
> Unfortunately this doesn't work - the second contact definition is
> silently ignored.
>
> I had a look at xodtemplate.c and this shows that even though the
> contact gets correctly added to the global xodtemplate_contact_list,
> it
> is not added to the appropriate skiplist because skiplist_insert() is
> only called when contact_name is directly specified.
>
> However, xodtemplate_resolve_contact() tries to inherit contact_name
> so
> I guess this behaviour was introduced with the skiplists.

I don't see why this shouldn't work.

Can you provide a patch against CVS HEAD, with tests in t/ for this
contact definition.

> A possible solution would be to add the call to skiplist_insert() into
> the resolve function where the inheritance takes place, or to maybe
> entirely move skiplist_insert() calls to
> xodtemplate_end_object_definition().

I'm not sure if adding skip lists later will break anything though.

Ton






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