Here are some essential commands to monitor the health and CPU utilization of your Ubuntu 22.04 server:
1. General System Information
View system information:
uname -a
Check uptime and load average:
uptime
View system memory and swap usage:
free -h
2. CPU Utilization
Display real-time CPU and memory usage:
top
Press q to exit.
Better interactive process viewer:
htop
(You may need to install it: sudo apt install htop)
Display CPU usage statistics:
mpstat 1 5
(Install with: sudo apt install sysstat)
3. Disk Usage
Check disk space usage:
df -h
Analyze disk usage in detail:
du -sh *
4. Network Monitoring
View network statistics:
ifconfig
(Install with: sudo apt install net-tools if not available)
Monitor network traffic in real-time:
nload
(Install with: sudo apt install nload)
5. System Logs
View system logs:
journalctl -xe
Tail system logs in real-time:
tail -f /var/log/syslog
6. Hardware Information
View CPU information:
lscpu
Check hardware information:
lshw -short
(Install with: sudo apt install lshw)
7. Resource Monitoring Utilities
Installsysstatfor detailed monitoring tools:
sudo apt install sysstat
Then use commands like:
iostat(for I/O stats)
sar(system performance stats)
Monitor system resource usage withglances:
sudo apt install glances
glances
8. Check Running Services
List running services:
systemctl list-units --type=service --state=running
9. Temperature and Sensors
Install and check hardware sensors:
sudo apt install lm-sensors
sudo sensors-detect
sensors
Would you like a script to combine these into a single health check?