in reply to Re: Sorting Cisco IP accounting data!
in thread Sorting Cisco IP accounting data!

Thanks for the info Zen. My main problem is that I
do not have full access to the routers since the
company I work for have them outsourced through a
rather inefficient third party. This means that I do
not have enable mode access and am very limited in
what I can do.

If I could get this sorting problem 'Sorted' I would
be happy. :)

Thanks for the input though,
Baiul.

  • Comment on Re: Re: Sorting Cisco IP accounting data!

Replies are listed 'Best First'.
Re: Re: Re: Sorting Cisco IP accounting data!
by zengargoyle (Deacon) on Feb 26, 2002 at 19:07 UTC
    foreach $key (sort keys %tt) { printf "%35s %15d\n",$key, $tt{$key}; }

    Assuming that works for you...

    while (($key, $value) = each %tt) { push @unsorted, [ $k, $v ]; } @sort_asc = sort { $a->[1] <=> $b->[1] } @unsorted; @sort_dsc = sort { $b->[1] <=> $a->[1] } @unsorted; print "low to high\n"; foreach (@sort_asc) { prinf "%35s %15d\n", $_->[0], $_->[1]; } print "\n"; print "high to low\n"; foreach (@sort_dsc) { prinf "%35s %15d\n", $_->[0], $_->[1]; }
Re: Re: Re: Sorting Cisco IP accounting data!
by zengargoyle (Deacon) on Feb 26, 2002 at 19:15 UTC

    Talk to them. If the router can do it, they should be happy to do it for you. It's easier on the router to export them than for you to continuously connect to the console and dump them. That's easier loadwise. IMNSHO using the console for this type of thing is bad.

    Setup on the router is 3 lines...

    ip flow-export source Loopback0 ip flow-export version 5 origin-as ip flow-export destination <your host> 2055 (plus turning on flow cache on the interfaces, but most do that by default, big win.)

    I would go so far as to say that if they wouldn't do this for you, Replace Them.

      Hehe funny you should say that ZEN, we are replacing
      them. They are terrible. thanks for the info though
      and I will try to get it sorted out. We did get the
      sort funciotn done though and it does work pretty damn
      well. Yell if anyone wants to see the code. But
      you are right, not good to do the logon all the time :(.

      I'll talk to the muppets about Flow exporting,
      Thanks again,
      Baiul.