Server resources monitoring with command-line tools



One of the most important duties of the system administrator is to monitor the system resources. This task should be done periodically because it reveals the system weaknesses and sometimes helps to improve the system performance.

This post describes how to gather essential system information using command-line tools.

CPU

dstat -C 0,1,total
iostat -c 2
htop -c
top

Get aggregate CPU usage for a particular process

Memory and Swap

dstat -m
vmstat -a 2
ps_mem.py
free -m
top
htop

Load average

dstat -l
tload
top
htop

Disks usage and I/O

dstat -D total
iostat -d 2
vmstat -d 2
df -h
stat -f /dev/hda

Network and bandwidth

jnettop
bmon
iftop
iptraf -i all
trafshow
dstat -N eth0,eth1,total
ifstatus

Files

lsof
fuser -mu /dev/sda1