New Feature: sorting of service- and hostnames in a domain-aware manner
Andreas Ericsson
ae at op5.se
Fri Apr 30 13:28:40 CEST 2004
Lars Volker wrote:
> I might be wrong, but i don't think theres a difference between sorting
> hostnames and/or ip-addresses, because the only way to confront the
> status.cgi with ips is when using them as hostnames in which case my
> algorithm will work as desired.....
>
> am i wrong?
>
Yes.
10.0.1.18 and 192.16.1.18 are on different networks, but will be sorted
as coming from the same domain according to your algorithm, while
10.0.1.20 would be considered a different country, while in fact being
on the same subnet (probably, anyways).
> lars
>
>
> Andreas Ericsson schrieb:
>
>> Lars Volker wrote:
>>
>>> Hi,
>>>
>>> thanks for that explanation.
>>> I've done a patch which also does compile. What it does is sort
>>> hostnames in a domains-aware manner by parsing them dot-wise
>>> beginning at the end. It's not a big thing, so I'd suggest reading
>>> the source....
>>>
>>> Does anyone think this would be of some use for one??
>>>
>> Probably, yes. At least if it gets coupled with some nice code for
>> sorting IP-addresses the same way (without resolving them, ofcourse),
>> since they're sorted 'the other way around'.
>>
>>> Thanks
>>> Lars
>>>
>>>
>>> Lars Volker schrieb:
>>>
>>>> Hi,
>>>>
>>>> wouldn't it be nice if nagios respectively the status.cgi would be
>>>> able to recognize, if two host- or servicenames are domain names,
>>>> which means dot-separated (like blabla.foo.bar.org.uk) and then sort
>>>> the list in an domain-aware kind of way?
>>>>
>>>> Example:
>>>> current behaviour:
>>>> a.x.org
>>>> a.y.org
>>>> b.x.org
>>>> b.y.org
>>>>
>>>> desired behaviour
>>>> a.x.org
>>>> b.x.org
>>>> a.y.org
>>>> b.y.org
>>>>
>>>> I've written a few lines of code, implementing that feature, but i
>>>> edited the source directly and have never worked with patching
>>>> stuff. So if someone would like to explain, i'll provide a patch.
>>>> Anyways the code is just about 9 lines long, simple hack only, but
>>>> working. There also should be some kind of switch to toggle the
>>>> behaviour.
>>>>
>>>> Thanks
>>>> Lars
>>>>
--
Mvh
Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
More information about the Developers
mailing list