RFC - Feature Template overrides Definition

Andreas Ericsson ae at op5.se
Thu Feb 14 13:56:21 CET 2008


Mark Eisenblaetter wrote:
> Hi List,
> 
> in my last confusing topic I tried to explain a problem I've got with
> configuration distribution design with nagios distributed monitoring.
> 
> I hope to clarify this topic and present a solution.
> 
> It would be nice if you can comment this again.
> 
> Actual situation with Nagios 3.x:
> If I would make my life easier with configuring nagios for my distributed
> system I would define some templates to control the behavior  on the master
> or on the slave.
> 
> f.e. on the slave a template would define a normal check_command, but no
> freshness options.
> 
> on the master server the same template name would result in some other
> check_command inclusive freshness options and so on.
> 
> With this possibility the service definitions on master _and_ on slave
> servers would be identically but the different templates on both sides would
> control "live checking" or "freshness checking".
> 
> But for this it should be possible that a template made directive should be
> able to override a directive from the service definition.
> 

Semantically, that's anathema. Plain and simple. A template should *never*
be allowed to override the actual object's definitions. Adding exclusions
to that simple rule would definitely muddy the waters between templates and
objects.

Besides that, I really don't see the point of it. If you have different
templates on the two servers anyway, why not just leave the options you
want overridden in the object configuration?

If you could perhaps post your templates for your master and slave and
one or two objects that use those template, I'm sure I could explain
how you can accomplish what you want, although I'm quite sure already
that you'd be off just fine if you left the template-controlled variables
out of the objects completely and set them to what they should be in the
templates on master and slave.

> I know that the default behavior is the other direction (template ->
> service, but service directives are last significant).
> 
> Since Nagios 3.x allows a template addition through the "+" notation my
> thoughts goes in this direction.
> What would be if you were allowed to inject a special character to your
> template to override a service definition (for example).
> 
> With attached patch I got exactly this behavior.
> 

I failed to see the point of your patch after having scrolled past
4 pages of function-renaming diff data. I *do* know that it doesn't
even compile with the attached patch. Since it doesn't compile, I'm
thinking you can't have tested this very well at all, and what you've
actually got running is something else, which you're not at all sure
works as per the current spec at all.

It doesn't compile because you have renamed
xodtemplate_clean_additive_string() to xodtemplate_clean_strings() and
then call it as xodtemplate_clean_string(). That change is just plain
noise and should never have made it into the diff. If you want me to
review it, resend with a minimal set of changes so I can see where the
logic happens without having to wade through page after page of nonsense.

I'm not saying I'm against the idea, but if you want your patch accepted
you need to put in at least a little effort.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list