[smokeping-users] Target sort order random

Tobias Oetiker tobi at oetiker.ch
Tue Mar 18 23:25:27 CET 2008


Hi Mel,

not sure what you see. There was a bug with menu ordering, but it
was fixed in 2.3.1 ... I just did find another one, so maybe this
is what confuses your setup.

Index: lib/Smokeping.pm
===================================================================
--- lib/Smokeping.pm    (revision 948)
+++ lib/Smokeping.pm    (working copy)
@@ -600,7 +600,7 @@
     my $print;
     my $current =  shift @{$open} || "";
     my @hashes;
-    foreach my $prop (sort {$tree->{$a}{_order} ? ($tree->{$a}{_order} <=> $tree->{$b}{_order}) : ($a cmp $b)}
+    foreach my $prop (sort {exists $tree->{$a}{_order} ? ($tree->{$a}{_order} <=> $tree->{$b}{_order}) : ($a cmp $b)}
                       grep {  ref $tree->{$_} eq 'HASH' and not /^__/ }
                       keys %$tree) {
             push @hashes, $prop;
@@ -733,7 +733,7 @@
     if ( $RRDs::VERSION >= 1.199908 ){
             $date =~ s|:|\\:|g;
     }
-    foreach my $prop (sort {$tree->{$a}{_order} ? ($tree->{$a}{_order} <=> $tree->{$b}{_order}) : ($a cmp $b)}
+    foreach my $prop (sort {exists $tree->{$a}{_order} ? ($tree->{$a}{_order} <=> $tree->{$b}{_order}) : ($a cmp $b)}
                       grep {  ref $tree->{$_} eq 'HASH' and not /^__/ }
                       keys %$tree) {
         my @slaves;


cheers
tobi


Today Chandler, Mel wrote:

> I copied the list of targets I had from another smokeping box I setup
> under WinXP to a FC8 box going from Smokeping 2.2.4 to 2.3.3.  The
> targets on the webpage seem to be listed at random, not in the order I
> put them in the config file.  Does anyone know if this is by design or
> if something new was done that's affecting the order?  Thanks
>
>
>
>
>
>
> Mel L. Chandler
>
> Yum! Brands, Inc.
> Network Engineering & Projects Team
> 17901 Von Karman Ave, MD602
> Irvine, CA 92614-6297
> + E-Mail  mel.chandler at yum.com <mailto:mel.chandler at yum.com>
> ( Office   +1 949-863-3830
> 2 Fax  +1 949-863-4507
> ; Pager  5622763375 at txt.att.net
> <mailto:5622763375 at txt.att.net?subject=Yum%20Page>
>
>
>
>
>
>
>
>
> This communication is confidential and may be legally privileged.  If you are not the intended recipient, (i) please do not read or disclose to others, (ii) please notify the sender by reply mail, and (iii) please delete this communication from your system.  Failure to follow this process may be unlawful.  Thank you for your cooperation.
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902



More information about the smokeping-users mailing list