Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

counting program

Hi,

Im looking for a tool that can count all the outgoing and incoming bytes get through my NIC. I need a summary of every hour(ie. how much data my pc send out and receive in from 1PM to 2PM) and a summary for the whole day and I also need a graph like MRTG does.
Thanks,

Stand
0
hstandit
Asked:
hstandit
4 Solutions
 
hegarsCommented:
there is network accounting for the linux kernel 2.4, thats will give you basic stats you need when ever you want it, you just need to configure MRTG to get this for you.

Regards,
Sebastian Hegarty.

ZDL Computing
http://www.zdlcomputing.com
0
 
hegarsCommented:
if you want to see what i mean let me know and ill send you the link to my status page
0
 
NMiCommented:
Use iptables that is installed into almost every Linux kernel. If you don't specify an action that should be performed with a particular criteria, it just counts packets and bytes.

For example, you can count all incoming traffic that your server receives from internet:

iptables -A INPUT -i <your incoming interface> -d <your ip address>

Next, you should type 'iptables -L INPUT' and you should see your statistics in corresponding line.

As the final step, you can write a small accounting script that will read these stats and dump them into your database on an hourly basis.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
aleph0xCommented:
Do netstat -in and see if you get what you need.
0
 
edeyCommented:
mmm, I (for purposes of play, I must admit) wanted something similar for my front page - http://fiftyfly.mine.nu has a tally of the last minutes worth of traffic on eth0 which was done with a croned script to parse /proc/net/dev.

GL
Mike
0
 
CleanupPingCommented:
hstandit:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now