OsGate.org Logo

Previous Previous | Next Next

Get system statistics - stat statistics iostat netstat mpstat

Networks Networks

Date 03.10.2011

Visits 2984



If you want to see some stats about your linux machine use the followings commands.

mpstat to show processor related stats.

bash-4.1# mpstat
Linux 2.6.38.2-smp (darkstar)   10/03/11        _i686_  (2 CPU)

14:54:58     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
14:54:58     all    7.00    0.28    3.16    0.63    0.00    0.40    0.00    0.00   88.53

iostat to show cpu stats and input/output stats of devices, partitions and network filesystem.

bash-4.1# iostat
Linux 2.6.38.2-smp (darkstar)   10/03/11        _i686_  (2 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.95    0.27    3.46    0.71    0.00   88.61

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda               4.60        77.79        33.99    2036477     889763

netstat to show network connections, routing table and interface statistics:

bash-4.1# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 192.168.2.4:48318       baymsg1010812.gate:1863 ESTABLISHED
tcp        0      0 192.168.2.4:58387       fx-in-f12:jabber-client ESTABLISHED
tcp        0      0 localhost:53113         localhost:37164         TIME_WAIT  
tcp        0      0 ::ffff:192.168.2.:46683 projects.sourcefor:http ESTABLISHED
Active UNIX domain sockets (w/o servers)
......