Recording Network Statistics

Networking/Security Forums -> UNIX // GNU/Linux

Author: tutaepakiLocation: New Zealand PostPosted: Mon Dec 02, 2002 10:12 pm    Post subject: Recording Network Statistics
    ----
I created a script which records my internet usage stats so I can get track of my volume. (I'm planning to move to a higher speed/lower cap cable
connection)

I get the bytes sent/received from /proc/net/dev but my numbers are always way above what my ISP shows. I'm thinking that it's because the stats in /proc include broadcasts, but my ISP's don't.

I've looked around /proc and searched but can't find any place where I can get hold of the broadcast vs Unicast vs Multicast traffic. I'd prefer not to have to use pcap, but at the moment that seems to be my only option.

Anyone know where else I might this info?

Thanks

Author: tutaepakiLocation: New Zealand PostPosted: Tue Dec 10, 2002 10:45 am    Post subject:
    ----
Answered my own question...if anyones interested...

I used iptables in the end....added a new chain called accounting
which has just 4 entries, all for the internet interface
Anything inbound
Anything outbound
Anything inbound to subnet broadcast address
Anything inbound to global broadcast address
None of which with a jump parm, so all they do is count the packets/bytes

Then I inserted a jump to the accounting chain on the INPUT, OUTPUT, and FORWARD chains, and every hour, read, save, and reset the counters.



Networking/Security Forums -> UNIX // GNU/Linux


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group