March 15, 2014

Produce and Deliver Reports on System Utilization (Processor, Memory, Disk, and Network).

Processor

System Activity Reporter, SAR. To display 5 samples with 2 seconds apart.

$ sar -u 2 5
...
12:01:10 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:01:12 PM     all      1.25      0.00      0.69      0.06      0.00     98.00
12:01:14 PM     all      1.56      0.00      0.56      0.00      0.00     97.88
...
-u      Report  CPU  utilization.

Memory

vmstat - Report virtual memory statistics. To display 5 samples with 2 seconds apart.

$ vmstat 2 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 9898656 325956 1829612    0    0     1     5   10    8  1  0 99  0  0 
 0  0      0 9898136 325960 1829692    0    0     0    24  721 3252  1  0 99  0  0 
...

Disk

Report file system disk space usage.

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_rhel6-lv_root
                       77G   19G   55G  25% /
tmpfs                 7.8G  740K  7.8G   1% /dev/shm
/dev/sda1             485M   87M  374M  19% /boot
/dev/mapper/vg_rhel6-lv_home
                       49G  7.8G   38G  18% /home
/dev/sdf1             3.8G  246M  3.5G   7% /media/0526-3346
-h, --human-readable    Print sizes in human readable format (e.g., 1K 234M 2G)

Statistics for input/output statistics for devices, partitions and network filesystems (NFS). To display 5 samples with 2 seconds apart.

$ iostat -dNk 2 5
...
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda               3.53         8.77        92.35    3226500   33970982
vg_rhel6-lv_root     4.70         8.63        22.48    3173286    8268420
vg_rhel6-lv_swap     0.00         0.00        55.68       1288   20479992
vg_rhel6-lv_home     3.55         0.13        14.20      48597    5222552
sdf               0.00         0.04         0.00      15962         11
...
-d     Display the device utilization report.
-N     Display the registered device mapper names for any device mapper devices.  
       Useful for viewing LVM2 statistics.
-k     Display statistics in kilobytes per second instead of blocks per second.  
       Data displayed are valid only with kernels 2.4 and later.

network

$ sar -n DEV
...
09:30:01 AM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
09:40:01 AM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:40:01 AM      eth0      0.16      0.16      0.04      0.04      0.00      0.00      0.00
09:40:01 AM     wlan0      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:40:01 AM    virbr0      0.28      0.41      0.05      0.06      0.00      0.00      0.00
09:40:01 AM virbr0-nic      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:40:01 AM     vnet0      0.11      0.61      0.03      0.06      0.00      0.00      0.00
09:40:01 AM     vnet1      0.16      0.81      0.02      0.05      0.00      0.00      0.00
09:50:01 AM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:50:01 AM      eth0      0.09      0.11      0.03      0.02      0.00      0.00      0.00
09:50:01 AM     wlan0      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:50:01 AM    virbr0      1.35      2.18      1.26      0.19      0.00      0.00      0.00
09:50:01 AM virbr0-nic      0.00      0.00      0.00      0.00      0.00      0.00      0.00
...

No comments: