Glances: Powerful System Monitor for Ubuntu Linux (CLI)

Now, I’ve written about many system monitor tools that can be used in Ubuntu in the recent past, but I think that, for most users, the default one that comes with Ubuntu (Gnome System Monitor) is more than enough. It has a pretty minimalist appearance, comes with reasonable amount of options and lets you get a “decent idea” about your computer, quickly (somewhat).

However, sometimes doing certain tasks such as finding an application that is buggy and consuming a lot of your resources is a bit difficult under it. Because once opened, first you have to click on the “Processes” tab and then have to find that program from a ‘big’ list where other running processes are also listed (to be fare it does show the top CPU ‘eaters’ at the top).

So wouldn’t it be nice if we had a system monitor that automatically highlights programs that are eating most of your CPU (including other resources) ?, because an approach as such makes it a breeze finding them, right ? Not only that …

Let’s say that you have a notebook that doesn’t have a HDD LED indicator (there are some), then how can you use the system monitor in Ubuntu to know whether your HDD is busy or not ? (sometimes a buggy program can use your HDD unnecessarily thus slowing it down or even crashing the PC. But without a LED indicator, it can be a bit hard to trace back the issue under such circumstances).

Oh it’s something ain’t it? ;-) … (I’ve highlighted a HDD I/O output in Blue)

Now again, for most users, those kind of information might not be that necessary. However, if you’re a power user who want a powerful system monitor that you can launch from the command-line interface, or …

Even as an average user, if you’re a bit annoyed by the fact the system monitor in Ubuntu makes you click through tab after tab for getting a quick sneak peak into your computer, then you might also be interested in an awesome tool called “Glances”.

It’s written in Python and uses the command-line. But as you can see from the above screenshot, it’s extremely well organized, uses different colors for indicating, thus as the name says, just Glance and you’ll see a lot ;-).

Few main features

*. CPU usage of: User (user based applications), Kernel (core programs of your OS), Nice value (a special value that prioritizes programs for using your CPU), Idel (indicates the resting time of your CPU, for that period).

*. The average CPU load of your computer for the past 1, 5 and 15 minutes.

*. The total memory capacity (RAM), Swap usage, free memory etc.

*. Download/upload rates of your network connections (right now it lacks showing a history of the total bandwidth usage, only shows the live rates).

*. Total number of processes, active ones, sleeping processes etc.

*. HDD related data: Current read or write speeds (also known as disk I/O details).

*. Currently mounted devices and their disk usage.

*. Shows your top processes (processes that consume most of your system’s resources) and their CPU/Memory usages, names and the actual path (location).

*. At the bottom, it displays the current date and time.

But most importantly, “Glances” highlights anything that’s misbehaving under its radar in Red ;-).

For instance, let’s say that due to a bug or something, the Firefox web browser started to consumed 100% of my CPU, then “Glances” will automatically highlight it from the list (by changing the color to Red from whatever the color it previously had), which makes identifying problems a breeze (well, somewhat! ;-)).

It has few indication color values and they are shown in the bottom status bar section (as shown below).

If interested, although it’s a very new utility, you can install “Glances” in Ubuntu 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04 Natty Narwhal, 10.10 and 10.04 by using the PPA provided by “Arnaud Hartmann” (thank you!).

For that, open your Terminal and enter the below commands.

sudo apt-add-repository ppa:arnaud-hartmann/glances-stable

sudo apt-get update

sudo apt-get install glances

That’s it!.

Update: “Arnaud” just let me know that there’s also a new PPA available which holds “dev builds” (unstable, cutting edge releases). So if you want to get the upcoming versions (features) before they’re officially released, you can use the below commands instead.

But please remember that, these are unstable packages and might contain bugs. If you’re not sure which to use, then just use the “stable” PPA (above) instead.

sudo apt-add-repository ppa:arnaud-hartmann/glances-unstable

sudo apt-get update

sudo apt-get install glances

Since it’s a command-line based tool, whenever you want to run it, open your Terminal and put the below command.

glances.py

You can also resize the Terminal window and it’ll automatically resize. However, to run it just make sure the Terminal has a size of “80×24″ at least, otherwise, if your terminal window’s size is too small, then it’ll output an error and won’t load (happened to me at first and I though it was a bug. But then I resized, it just in case :D, and it worked).

The update interval is set to 1 second by default. But you can use the below command to change it (just replace “2″ with your value).

glances.py -t 2

To exit “Glances”, just type “q”.

If you think opening the terminal (just to run it) is a bit of a hectic task (you GUI loving geek!, kidding ;-)), then you can install a drop-down terminal emulator like Tilda for instance. After combining “Glances” with that, you can have it running in your Terminal and hide/show it easily with a keyboard shortcut!.

“Glances” is also very resources friendly too. Gnome system monitor needs about 2.5x times more CPU (mostly to draw them pretty graphics, I think) and eats a lot more RAM than “Glances” does.

So anyway, as mentioned above, for most users, this might not be that big of a deal. But if you’re a power user who’d like to easily get some “sense” out of your PC by just glancing at your Terminal, then this will come in handy for you :D. Good luck.

6 thoughts on “Glances: Powerful System Monitor for Ubuntu Linux (CLI)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>