DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Bandwidth Monitoring From The Console Using 'pktstat'

01.31.2006
| 3758 views |
  • submit to reddit
        Pktstat, http://www.adaptive-enterprises.com.au/~d/software/pktstat/, displays a real-time summary of packet activity on an interface. Each line displays the data rate associated with a particular class of packets. The class is determined by the packet header.

For example, 'pktstat -w1' will refresh once per second showing the average bandwidth usage and active connections:

# pktstat -w1

  interface: eth0 
  load averages: 285.9k 167.3k 67.3k bps 

    bps    % desc 
  466.8   0% arp 
             tcp 205.188.1.192:5190 <-> c-24-21-74-176:1472 
   6.0k   0% tcp c-24-21-74-176:3933 <-> host75:3724 
  63.5k   1% tcp c-24-21-74-176:4662 <-> p50906304:61951 
  27.4k   0% udp 10.141.192.1:bootps <-> 255.255.255.255:bootpc