Home > linux > Linux System Statistics (sysstat)

Linux System Statistics (sysstat)

iostat – Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions

[x@mar nodes]$ iostat -d 2
Linux 3.10.0-123.8.1.el7.x86_64 (mar) 	11/02/2014 	_x86_64_	(4 CPU)

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda               8.06        63.19       158.29   75199083  188364685
scd0              0.01         0.88         0.00    1048848          0
dm-0              8.30        35.15        87.59   41825965  104228088

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda               0.50         2.00         0.00          4          0
scd0              0.00         0.00         0.00          0          0
dm-0              0.00         0.00         0.00          0          0

prtstat – print statistics of a process

[x@mar nodes]$ prtstat -r 495
         pid: 495            	                  comm: su
       state: S              	                  ppid: 22738
        pgrp: 495            	               session: 22738
      tty_nr: 34820          	                 tpgid: 501
       flags: 406100         	                minflt: 1803
     cminflt: 1694           	                majflt: 5
     cmajflt: 4              	                 utime: 0
       stime: 1              	                cutime: 2
      cstime: 1              	              priority: 20
        nice: 0              	           num_threads: 1
 itrealvalue: 0              	             starttime: 107674910
       vsize: 187473920      	                   rss: 543
      rsslim: 18446744073709551615	             startcode: 1
     endcode: 1              	            startstack: 0
     kstkesp: 0              	               kstkeip: 0
       wchan: 18446744073709551615	                 nswap: 0
      cnswap: 18446744073709551615	           exit_signal: 17
   processor: 0              	           rt_priority: 0
      policy: 0              	 delayaccr_blkio_ticks: 48
  guest_time: 0              	           cguest_time: 0

nfsiostat – Report input/output statistics for network filesystems (NFS)

stat – display file or file system status

[x@mar nodes]$ stat recognizer.py 
  File: ‘recognizer.py’
  Size: 6476      	Blocks: 16         IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 1312342     Links: 1
Access: (0775/-rwxrwxr-x)  Uid: ( 1000/   x)   Gid: ( 1000/   x)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2014-10-23 21:45:10.041988240 -0400
Modify: 2014-10-23 21:44:21.157301676 -0400
Change: 2014-10-23 21:44:21.157301676 -0400
 Birth: -
[root@mar nodes]$ stat /dev/sda
  File: ‘/dev/sda’
  Size: 0         	Blocks: 0          IO Block: 4096   block special file
Device: 5h/5d	Inode: 8544        Links: 1     Device type: 8,0
Access: (0660/brw-rw----)  Uid: (    0/    root)   Gid: (    6/    disk)
Context: system_u:object_r:fixed_disk_device_t:s0
Access: 2014-11-02 10:52:15.531399767 -0500
Modify: 2014-10-20 03:58:56.852349054 -0400
Change: 2014-10-20 03:58:56.852349054 -0400
 Birth: -

ntpstat – show network time synchronisation status
netstat – Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

[x@mar nodes]$ netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      943/dovecot         
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1017/nginx          
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      516/sshd            
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      975/sendmail        
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      1017/nginx          
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN      943/dovecot         
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      999/php-fpm         
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      906/mysqld          
tcp        0      0 0.0.0.0:587                 0.0.0.0:*                   LISTEN      975/sendmail        
tcp        0      0 :::143                      :::*                        LISTEN      943/dovecot         
tcp        0      0 :::22                       :::*                        LISTEN      516/sshd            
tcp        0      0 :::993                      :::*                        LISTEN      943/dovecot

turbostat – Report processor frequency and idle statistics

[root@mar nodes]# turbostat -i 5
cor CPU    %c0  GHz  TSC SMI    %c1    %c3    %c6    %c7 CTMP PTMP   %pc2   %pc3   %pc6   %pc7  Pkg_W  Cor_W GFX_W
         33.42 2.67 2.29   0  44.56   3.82   0.09  18.10   70   70   0.97   0.52   1.22   0.13  16.62  13.12  0.22
  0   0  30.49 2.65 2.30   0  45.78   4.31   0.12  19.29   66   70   0.97   0.52   1.22   0.13  16.62  13.12  0.22
  0   2  33.77 2.70 2.29   0  42.50
  1   1  30.31 2.62 2.29   0  49.39   3.33   0.06  16.90   70
  1   3  39.12 2.70 2.29   0  40.58
cor CPU    %c0  GHz  TSC SMI    %c1    %c3    %c6    %c7 CTMP PTMP   %pc2   %pc3   %pc6   %pc7  Pkg_W  Cor_W GFX_W
         33.54 2.64 2.29   0  44.24   3.31   0.18  18.74   70   70   1.12   0.38   1.62   0.28  16.55  12.97  0.31
  0   0  30.91 2.62 2.29   0  45.92   3.59   0.04  19.52   67   70   1.12   0.38   1.62   0.28  16.55  12.97  0.31
  0   2  35.41 2.65 2.29   0  41.43
  1   1  29.13 2.60 2.29   0  49.58   3.03   0.31  17.95   70
  1   3  38.69 2.69 2.29   0  40.02

vmstat – Report virtual memory statistics. vmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity

Usage:
 vmstat [options] [delay [count]]

Options:
 -a, --active           active/inactive memory
 -f, --forks            number of forks since boot
 -m, --slabs            slabinfo
 -n, --one-header       do not redisplay header
 -s, --stats            event counter statistics
 -d, --disk             disk statistics
 -D, --disk-sum         summarize disk statistics
 -p, --partition   partition specific statistics
 -S, --unit       define display unit
 -w, --wide             wide output
 -t, --timestamp        show timestamp

 -h, --help     display this help and exit
 -V, --version  output version information and exit

lpstat – print cups status information. lpstat displays status information about the current classes, jobs, and printers.

[root@marko nodes]# lpstat -s
system default destination: HP-LaserJet-200-color-M251nw
device for HP-LaserJet-200-color-M251nw: dnssd://HP%20LaserJet%20200%20color%20M251nw%20(0520CB)._pdl-datastream._tcp.local/

cifsiostat – Report CIFS statistics.Displays statistics about read and write operations on CIFS filesystems.

[root@marko Downloads]# cifsiostat
Linux 3.10.0-123.8.1.el7.x86_64 (mar) 	11/02/2014 	_x86_64_	(4 CPU)

Filesystem:                    rB/s         wB/s    rops/s    wops/s         fo/s         fc/s         fd/s
\\192.168.1.50\backup0      1044.03       899.66      0.02      0.01         0.00         0.00         0.00 
\\192.168.1.50\backup1     11373.32       473.36      0.25      0.08         0.06         0.06         0.00 
\\192.168.1.50\backup2         7.45      1919.59      0.00      0.03         0.00         0.00         0.00 
\\192.168.1.50\media           0.00         0.00      0.00      0.00         0.00         0.00         0.00 

pidstat – Report statistics for Linux tasks. Used for monitoring individual tasks currently being managed by the Linux kernel.

[root@mar ~]# pidstat -U apache
Linux 3.10.0-123.8.1.el7.x86_64 (mar) 	11/02/2014 	_x86_64_	(4 CPU)

10:08:25 PM     USER       PID    %usr %system  %guest    %CPU   CPU  Command
10:08:25 PM   apache      1366    0.00    0.00    0.00    0.00     1  httpd
10:08:25 PM   apache      1450    0.00    0.00    0.00    0.00     2  httpd
10:08:25 PM   apache      1592    0.00    0.00    0.00    0.00     2  httpd
10:08:25 PM   apache      1905    0.00    0.00    0.00    0.00     0  httpd
10:08:25 PM   apache      7216    0.00    0.00    0.00    0.00     0  httpd
10:08:25 PM   apache      7283    0.00    0.00    0.00    0.00     3  httpd
10:08:25 PM   apache     17114    0.00    0.00    0.00    0.00     3  httpd
10:08:25 PM   apache     29815    0.00    0.00    0.00    0.00     2  httpd
10:08:25 PM   apache     30103    0.00    0.00    0.00    0.00     1  httpd
10:08:25 PM   apache     30912    0.00    0.00    0.00    0.00     1  httpd

db_stat – Displays statistics for Berkeley DB environments.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: