Monitoring the seemingly vast ocean of Linux nuances requires a little patience, and a handful of useful utilities. After discovering a few unresponsive NodeJS applications and other Apache-hosting-related issues, I went in search of the perfect system-monitoring utilities.
top – Linux Process Monitoring
Most of the issues you will encounter in Linux will usually have to do with a process consuming too many system resources like memory or CPU.
Just start up top, and by default, it will show you the CPU utilization of each process. you should shart the program using
top -c or the process name may be truncated.
<SHIFT><F>, you can sort and filter on many useful metrics, such as memory usage and CPU utilization.
htop – A Fancier Linux Process Monitor
If you want to make a better top utility, stick an “H” in front. The
htop utility does everything the top utility does, but adds a process tree view, some ASCII graphs, and on-screen keyboard command bar.
df – Disk Free Utility
When you just need to know the amount of free space,
df is a very fast and compact utility.
ncdu – NCurse Disk Usage Viewer
du which will list every file and folder and the space being used by it,
ncdu will produce nice graphs and stats of the file and directory sizes and allow you to navigate through to find to space hogs.
This utility is not included in many distributions by default but you can easily install in most platforms with
sudo apt-get install ncdu.
lof – List of Open Files
If you really like lists, this utility will really make you smile. Entering
lsof without any arguments will list all the files in use on your Linux system. Better to enter
lsof | more if you’re more the pagination type.
pm2 – Production Runtime and Process Manager for Node.js Applications
If you’re just looking for the vitals on your Node.js processes, and you’re using PM2 to start them, a simple
pm2 status will display an overview while
pm2 log will show the node application logs.
netstat – Network Utility Tool to Display Ports
The Netstat utility is great for showing open and waiting connections on your Linux box. My favorite is
sudo netstat -tulpn which shows a list of listening ports and processes.
w3m – A Text-Based Web Browser
Hey! This isn’t a system-monitoring utility. No, but a tomato isn’t a vegetable, either.
The reason I included this little utility is that it’s very helpful in determining if a site (or Node application) is available without going through firewalls, redirects, and other obstacles.
For example, running w3m
http://localhost:8080, I can tell if my Node application is running correctly.
netdata – the Britney Spears of Linux Monitoring
..of course, you could install NetData and monitor just about every key component on your system in a browser.
Thanks for reading! Please subscribe and share!
Former owner of an I.T. consultancy business in Southampton, NY, Carl gave up the hustle-bustle of I.T. to live his dream of becoming a full-time application developer. When not busy blogging or programming, you might find Carl out taking a ride on his motorcycle or hiking off in some woodland trails.