Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using Ubuntu.

I need to count the number of packet received in a specific interface. I found this can be done using netstat. However, I need to count starting from t=zero until a specific time I want (t=...) and the counter shall be start from zero

This can be done if everytime I restart the computer so the counter starts from zero, but I just want to know if there is any other solution to capture how many packets on a specific interface within a certain time I want.

share|improve this question
    
Interface stats are available via SNMP. –  Zoredache Jan 30 '12 at 18:13
    
@zoredache : yes, and also in other tools that basically take the stat from /proc/sys.. but i am curious how to make the packet counter to 0, without having to restart the machine all the time –  heike Jan 30 '12 at 18:37
    
    
@Zoredache : lol linkception :D thank you (unfortunately you post in comment, not the answer. I can not accept the answer) –  heike Jan 30 '12 at 19:12
    
If that question does have the answers you need, then I'll vote to close this question as a duplicate of that. –  Zoredache Jan 30 '12 at 19:36

1 Answer 1

up vote 0 down vote accepted

I am afraid there is no way to reset counters without restarting ( or unload-load cycle nic card module if nic is loaded via dynamic module.)

Virtual zero-ing concept is discussed here though.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.