Notification period inheritance problem
Gordon Messmer
yinyang at eburg.com
Wed Dec 16 00:26:50 CET 2009
On 12/15/2009 01:38 PM, Marc Powell wrote:
> On Dec 15, 2009, at 2:04 PM, Gordon Messmer wrote:
>
>> Quoting from the documentation:
>>
>> The following table lists the object variables that will be implicitly inherited from related objects if you don't explicitly specify their value in your object definition or inherit them from a template
>>
>> ...so I need to not inherit the value from my template. How do I do that?
>>
> Don't specify the directive in the template.
>
Which means that I have to expand the template where I null-ify the
notification period with the values from any of the templates it
"uses". That seems like a minor inconvenience, but it's still uglier
than it ought to be. When I do so, I still get the warning from "nagios
-v". I'll test it to make sure that it's working.
>> In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" (without quotes) as the value of the variable that you do not want to inherit.
>>
> You're mixing sections of the documentation to try to make a connection that doesn't exist.
If that's so, then at the very least the documentation should be updated
to note that this won't work.
> Again, specified with a value of 'null' does not equate to unspecified. Looking at the code, if you specify the value in any way, including a value of 'null', it breaks the implied inheritance.
>
> xodtemplate.h --
>
> #define XODTEMPLATE_NULL "null"
>
> xdata/xodtemplate.c --
>
> else if(!strcmp(variable,"notification_period")){
> if(strcmp(value,XODTEMPLATE_NULL)){
> if((temp_service->notification_period=(char *)strdup(value))==NULL)
> result=ERROR;
> }
> temp_service->have_notification_period=TRUE;
> }
>
That sure looks like a bug to me. Even the indentation looks weird to
me, is that the normal style? I can't imagine why "null" would be
considered a valid notification period. If
have_notification_period=TRUE were in the preceding block, the
documentation would make more sense, and implied inheritance would be a
lot easier to use. Do you think a patch to modify this behavior would
be accepted?
Thanks for the explanation. I appreciate your help.
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list