Joined: 02 May 2002 Posts: 3 Location: New Zealand
Posted: 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.
Joined: 02 May 2002 Posts: 3 Location: New Zealand
Posted: 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.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum