Some searching will help with the sorting question... However there's a better way. Check if your router is capable of Netflow export. You can have the routers export to a collector machine, much much better than polling the router for stats.

I'm using the cflowd package (C code) to collect the flows, but for processing there's Cflow.pm (same guy who wrote cflowd). A typical export looks something like:

$ flowdumper -e '($exporterip eq "192.168.251.43") && ($input_if == 6) +' -c ../flows.current FLOW index: 0xc7ffff router: 192.168.251.43 src IP: 64.12.27.230 dst IP: 192.168.252.188 input ifIndex: 6 output ifIndex: 9 src port: 5190 dst port: 2877 pkts: 11 bytes: 2291 IP nexthop: 192.168.254.1 start time: Mon Feb 25 16:29:47 2002 end time: Mon Feb 25 16:32:42 2002 protocol: 6 tos: 0x0 src AS: 0 dst AS: 0 src masklen: 0 dst masklen: 24 TCP flags: 0x1a (SYN|ACK|PUSH) engine type: 1 engine id: 1 ...snip... matched 19333 of 27695 flows $

The tools available are quite flexible. FlowScan is a perl application to gather stats/make graphs with a backend RRD database. If nothing else it's a good place to start rolling your own.


In reply to Re: Sorting Cisco IP accounting data! by zengargoyle
in thread Sorting Cisco IP accounting data! by Baiul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.