Search This Blog

2012-11-14

Network Monitoring CentOS

To monitor network statistics on CentOS one of the easiest ways is to use the built in utility "sar". I have found that even though sysstat is not installed on CentOS 6.3 it still installed separately.

To get continuous network statistics use the following:
sar -n DEV 1 3

Sample Output:
# sar -n DEV 1 3
Linux 2.6.32-279.el6.x86_64 (hostname)       11/14/2012      _x86_64_        (1 CPU)

08:28:06 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
08:28:07 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
08:28:07 PM      eth0   2615.96   1324.47   3338.49    137.90      0.00      0.00      0.00

08:28:07 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
08:28:08 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
08:28:08 PM      eth0   2756.38   1401.06   3515.59    121.71      0.00      0.00      1.06

08:28:08 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
08:28:09 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
08:28:09 PM      eth0   2743.01   1400.00   3478.34    213.58      0.00      0.00      0.00

Description of Command:
-n DEV - With the DEV keyword, statistics from the network devices are reported.
1 -  Interval
3 -  Count

Another keyword I find particularly useful is EDEV. This shows all interface drop statistics.

List of possible keywords:
DEV, EDEV, NFS, NFSD, SOCK, IP, EIP, ICMP, EICMP, TCP, ETCP, UDP, SOCK6, IP6, EIP6, ICMP6, EICMP6 and UDP6.

Check out the man page for more information:
man sar

More useful sar commands and functions in the following link:
http://www.cyberciti.biz/tips/identifying-linux-bottlenecks-sar-graphs-with-ksar.html

No comments:

Post a Comment