Have you ever looked at your server and felt a little confused about what was going on? I’ve been there before too, and you really don’t need any complicated tools to know whether or not your server is "OK". There is so much you can check much easier for your server health! Doesn’t that sound nice?!
You can check disk health by using:
I check with:
You can get your logs from:
First things first, CPU Usage
I always start with CPU usage. When the CPU is 100% utilization continuously, the server generally feels slow (or not responsive at all). Luckily you can monitor this with a few different commands:- top - Gives you live CPU usage
- htop - Very similar to top but much easier to read
- mpstat - CPU usage per core in case you want to look at CPU core utilization
Memory (RAM) Usage
Servers also slow down when RAM usage hits 100%. To check memory usage, you can use the following commands:- free -h
- vmstat
- top
Disk Usage
Next, I check the disk. A full disk may cause your apps to crash. That is the worst surprise.You can check disk health by using:
- df -h – shows free and used disk
- du -sh foldername – shows folder size
- iostat - shows disk speed and load
Network Health
Have you ever thought why your site opens slowly? It could be the network.I check with:
- ping – checks if the server replies
- netstat - shows connection
- iftop - shows bandwidth live
System Logs
Logs tell you everything, I mean everything. Every time something gets broken, my first place I look is the logs.You can get your logs from:
- /var/log/syslog
- /var/log/messages
- journalctl