Quick Linux Tip #78:
Question: Which network interface is being overloaded?
Try: sar -n DEV 1 5
Info: sar -n DEV displays real-time network interface statistics. The 1 5 arguments sample network activity every 1 second for 5 samples, showing throughput such as rxkB/s and txkB/s, along with packet rates.
Examples:
- $
sar -n TCP 1 10# Monitor TCP connection statistics - $
sar -n SOCK 1# Track active socket usage - $
vnstat -l -i eth0# Monitor live traffic on eth0
Note: Install sar with sudo apt install sysstat. Enable persistent statistics in /etc/default/sysstat. Use -u for CPU, -r for memory, and -d for disk statistics when performing broader system health checks.
Leave a Reply