[smokeping-users] Re: _order

Tobias Oetiker oetiker+r at ee.ethz.ch
Sun Feb 1 20:31:55 MET 2004


Hi Ali,

the _order element of the parser which is set to 1 causes
ISG::ParseConfig to supply an _order propperty in the config hash
which represents the order of things in the config files ...

     _order      If defined, a '_order' element will be put in
                 every hash containing the sections with a number
                 that determines the order in which the sections
                 were defined.

The reason for all this is to maintain the order of things in the
config file in the on-screen presentation as well.

So if you want targets in alphabetical order on screen, put them in
alphabetical order in your config file ...

it used to be different in old versions of smokeping, there things
on screen got sorted automatically, but this caused all those to be
unhappy who orderd things in their config file differently and saw
their effort nulled.

cheers
tobi


Wednesday Ali ISIK wrote:

> Hi, all -- our users were complaining about targets not being
> in alphabetical order.  As we have hundreds of targets, it becomes
> more and more difficult over time to make sure that the targets
> are in alphabetical order in the config file.  I checked out the
> source and saw the
>
>     { $tree->{$a}{_order} <=> $tree->{$b}{_order}}
>
> comparison block.  This _order seems to be left with its default
> value of 1, which of course is the same for all our targets.  I put
> in the following hack as a quick fix:
>
> #    foreach my $prop (sort { $tree->{$a}{_order} <=> $tree->{$b}{_order}}
>     foreach my $prop (sort { $tree->{$a}{menu} cmp $tree->{$b}{menu}}
>
> _order seems to be an internal variable.  Is there a way for the
> user to choose the sort mechanism?  I ran a search for _order and
> came up empty.  Please ignore me if I am raising an rtfm sense.
>
> (I also worked out a few dirty fixes for mod_perl errors that I would
> like to share if there is interest.)
>
> best,
>
> --ali
>
> --
> Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
> Archive     http://www.ee.ethz.ch/~slist/smokeping-users
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETZ J97, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/~oetiker   +41(0)1-632-5286

--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/smokeping-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the smokeping-users mailing list