If you’re a Linux administrator, you know that information is valuable. Without the ability to quickly gain insight into data center servers, troubleshooting becomes exponentially more difficult. Because of that, you need that information at a glance. But when your Linux servers are sans a desktop environment, how do you get the information you need?
There are many tools available that provide various bits of information. For many admins, the first tool to use is the top command. But for some, top misses out on some crucial information. What if there is a terminal app that can provide you with more information than top? That tool does exist, and it’s called Glances.
Glances is a text-based monitor that provides information about:
- Process list
- Network interface
- Disk I/O
- IRQ / Raid
- Filesystem (and folders)
- System info
- Quicklook (CPU, MEM, LOAD)
Glances even includes a web-based GUI that makes monitoring even more flexible. Let’s install and use Glances on Ubuntu Server 18.04 (fear not, Glances can be installed on most distributions, from the standard repository).
SEE: Securing Linux policy (Tech Pro Research)
The installation is quite simple. Open a terminal window and issue the command:
sudo apt-get install glances
Once the installation completes, you’re ready to use the app.
Issue the command glances and the curses-based tool will open (Figure A).
As you can see, there’s plenty of information available. However, you can get more. Glances includes a handy sidebar that adds a bit more information (like Docker container network I/O). To open the sidebar (Figure B), hit the 2 key on your keyboard.
The sidebar includes Network and Disk I/O, as well as Docker information (if installed and running), as well as ping times to the default gateway. To close Glances, hit the [Ctrl]+[c] key combination on the keyboard.
Web server mode
The next trick is to run Glances in web server mode. To do this, start Glances with the command:
The above command will only output that the webserver has started. You can then point a web browser to http://SERVER_IP:61208 (where SERVER_IP is the IP address of the server hosting glances). The interface you’ll see in the web browser is exactly the same as what you saw in the terminal window, only from within a web browser. To kill the web server instance, go back to the terminal running the command and hit the [Ctrl]+[c] key combination.
Easy Linux server monitoring
Monitoring your Linux server has never been easier. If the top command doesn’t display enough information, but you like the interface-layout, Glances certainly fills the need for slightly more information that top misses.