Hi,<br><br><div class="gmail_quote">On Thu, Feb 14, 2008 at 1:56 PM, Andreas Ericsson <<a href="mailto:ae@op5.se">ae@op5.se</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Mark Eisenblaetter wrote:<br>
> Hi List,<br>
><br>
> in my last confusing topic I tried to explain a problem I've got with<br>
> configuration distribution design with nagios distributed monitoring.<br>
><br>
> I hope to clarify this topic and present a solution.<br>
><br>
> It would be nice if you can comment this again.<br>
><br>
> Actual situation with Nagios 3.x:<br>
> If I would make my life easier with configuring nagios for my distributed<br>
> system I would define some templates to control the behavior  on the master<br>
> or on the slave.<br>
><br>
> f.e. on the slave a template would define a normal check_command, but no<br>
> freshness options.<br>
><br>
> on the master server the same template name would result in some other<br>
> check_command inclusive freshness options and so on.<br>
><br>
> With this possibility the service definitions on master _and_ on slave<br>
> servers would be identically but the different templates on both sides would<br>
> control "live checking" or "freshness checking".<br>
><br>
> But for this it should be possible that a template made directive should be<br>
> able to override a directive from the service definition.<br>
><br>
<br>
</div>Semantically, that's anathema. Plain and simple. A template should *never*<br>
be allowed to override the actual object's definitions. Adding exclusions<br>
to that simple rule would definitely muddy the waters between templates and<br>
objects.</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Besides that, I really don't see the point of it. If you have different<br>
templates on the two servers anyway, why not just leave the options you<br>
want overridden in the object configuration?<br>
<br>
If you could perhaps post your templates for your master and slave and<br>
one or two objects that use those template, I'm sure I could explain<br>
how you can accomplish what you want, although I'm quite sure already<br>
that you'd be off just fine if you left the template-controlled variables<br>
out of the objects completely and set them to what they should be in the<br>
templates on master and slave.</blockquote><div><br>Should we do this in this thread or in the initial thread?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<div class="Ih2E3d"><br>
> I know that the default behavior is the other direction (template -><br>
> service, but service directives are last significant).<br>
><br>
> Since Nagios 3.x allows a template addition through the "+" notation my<br>
> thoughts goes in this direction.<br>
> What would be if you were allowed to inject a special character to your<br>
> template to override a service definition (for example).<br>
><br>
> With attached patch I got exactly this behavior.<br>
><br>
<br>
</div>I failed to see the point of your patch after having scrolled past<br>
4 pages of function-renaming diff data. I *do* know that it doesn't<br>
even compile with the attached patch. Since it doesn't compile, I'm<br>
thinking you can't have tested this very well at all, and what you've<br>
actually got running is something else, which you're not at all sure<br>
works as per the current spec at all.<br>
</blockquote><div><br>Ok i will look at this. And will do more testing befor submitting the new version.<br><br>one question is it better to patch against the last release or the last cvs checkout.<br>I used the last checkout.<br>
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
It doesn't compile because you have renamed<br>
xodtemplate_clean_additive_string() to xodtemplate_clean_strings() and<br>
then call it as xodtemplate_clean_string(). That change is just plain<br>
noise and should never have made it into the diff. If you want me to<br>
review it, resend with a minimal set of changes so I can see where the<br>
logic happens without having to wade through page after page of nonsense.</blockquote><div><br>there are both funktions in xodtemplate.c and i can't find one wrong renaming.<br><br>I don't want to produce double code so i used addaptive funktions to provide the Cleaning in my case.<br>
in line  98 - 99  you can see that i added my char (=) for cleanup in the xodtemplate_clean_additive_string funktion and added the handling of the check_command (Host Line 199 service 214) in the xodtemplate_clean_additive_strings funktions.<br>
<br>In this case i tought it would be better to rename the funktion because they are not handling  addaptive-only anymore.<br><br>So what the "best" way to do in this case?<br>1. Double the xodtemplate_clean_additive_string and xodtemplate_clean_additive_strings<br>
2. Use the both funktions an rename them<br>3. Use both funktions and don't touch the name<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
I'm not saying I'm against the idea, but if you want your patch accepted<br>
you need to put in at least a little effort.<br>
<br></blockquote></div>That's why i start to write the patch but it's my first C++ patch and my programming skills are not the best.<br><br>Mark<br>