Inheritance

John P. Rouilard rouilj+nagiosdev at cs.umb.edu
Tue Feb 6 16:55:40 CET 2007


In message <45C83339.3010304 at financial.com>,
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 +<string> looks a bit awkward to me. Also considering how you use
>>>>> "!" as a unary operator +<string> 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 +<string> and !<string> 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.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list