As an admin for a Linux server, you are always engaged in monitoring. You use the default system tools but also can utilize more complex monitoring tools.
top
top
and you’ll see a list of processes sorted by CPU usage by default.-d [seconds]
- Set delay between updates.-o [field]
- Sort by a specific field, e.g., memory usage.htop
top
, with a better interface and more options.htop
and you get a color-coded, more user-friendly display.vmstat
(Virtual Memory Statistics)vmstat [delay] [count]
vmstat 5 10
will report stats every 5 seconds, 10 times.iostat
(I/O Statistics)iostat
to view CPU and I/O statistics.iostat 2
will refresh every 2 seconds.netstat
/ ss
netstat -tuln
(to view listening ports).ss -tuln
(modern replacement for netstat
).sar
(System Activity Report)sar -u 5
(CPU utilization every 5 seconds).sar -r
(memory usage stats).dmesg
dmesg
(for a full dump), dmesg -w
(to follow live updates).journalctl
journalctl -xe
(view errors).journalctl -f
(follow live log output).nmon
nmon
and press different keys (e.g., c
for CPU, m
for memory).sudo apt install nmon
.glances
glances
to see system metrics.iftop
sudo iftop
to display network activity on a given interface.-i [interface]
to monitor a specific network interface.nload
nload
and see network activity in a text-based graph.tcpdump
sudo tcpdump -i eth0
to capture packets on interface eth0.ps
ps aux
to view all running processes.ps -eF
to display extended process information.kill
and killall
kill [PID]
sends a signal to a specific process by ID.killall [process_name]
kills all instances of a process.