Re: [Nagios-devel] Inheritance
-
Guest
Re: [Nagios-devel] Inheritance
In message ,
Christoph Maser writes:
>John Relph schrieb:
>> Christoph Maser writes:
>> John Relph wrote:
>>>>> Christoph Maser writes:
>>>>> Could we change that to read
>>>>>
>>>>> hostgroups +, linux-servers,web-servers
>>>>>
>>>>>
>>>>> this + looks a bit awkward to me. Also considering how you use
>>>>> "!" as a unary operator + makes people think the "+" is an
>>>>> operator for the following string.
>>>>>> Disagreed. Your proposed syntax is more confusing. Your syntax makes
>>>>>> it look like "+" is itself a hostgroup (albeit with special meaning).
I kind of like the bare + myself. A bare + means take the
virtual/dynamic hostgroup defined by applying the hostsgroup
durectives in used templates and use it as the base. So the + it is
sort of a virtual/dynamic hostgroup defined by the other templates.
>>>>>> The original syntax is well known and understood. For example, Apache
>>>>>> configuration files use the "+" as proposed below.
>> i see your point but i really think the way + and ! are
>> used are not very consistent. I'm not quite certain which parts in
>> httpd-config you mean? [...]
>>
>>> See http://httpd.apache.org/docs/2.0/mod/core.html#options
>>
>>> ... if all the options on the Options directive are preceded by a +
>>> or - symbol, the options are merged. Any options preceded by a + are
>>> added to the options currently in force, and any options preceded by
>>> a - are removed from the options currently in force.
>>
>>> Which basically says you can do this:
>>
>>> hostgroups +linux-servers,web-servers
>>
>>> which adds the specified groups to those inherited from the template,
>
>Really? Mabye you missed a thing: 1st it says "if all the options..."
>and then very definitely:
> [elided warning against using ptions without a preceeding +/-]
>>> or this:
>>
>>> hostgroups +linux-servers,-web-servers
>>
>>> which adds the first group to and removes the second group from those
>>> inherited from the template, or this:
>>
>>> hostgroups linux-servers,web-servers
>>
>>> which replaces any groups inherited from the template with those
>>> specified.
>>
>Well that makes sense!
>>> I don't know if we need the minus "-" operator for Nagios (though I
>>> suppose if we built it, they would come).
>I would love to see that beeing added.
It's already there effectively: !web-servers
n
>Just to clarify what i disliked about the original posting. If I see
>"+group1,group2" whith the comment Ethan gave is see "+(group1,group2)"
>But what you all meant was "+group1,+group2".
Agreed.
>As you can see this is not absolutely obvious, even if you would define
>missing +es as beeing implicitly added i would propose throwing a warning.
>Even better declare the mixed syntax invalid (just like apache does but
>in contrast to their config parser actually throw an error) just to
>avoid any kind of confusion which might happen.
>
>Yes I know its totally pedantic, but i really think these kind of
>details make a differnce in software quality.
Yup. I have to agree.
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]