How to Easily Track CPU and Memory Usage in Ubuntu Using Indicator-Sysmonitor

While there are many system monitoring applications available for Ubuntu, most of them display information in their own window – be it a command line shell or GUI. However, if you’re looking to continuously monitor a handful of system parameters in simple text form, and do not want to waste time switching windows, getting the information displayed on the panel is an ideal solution.

In this article, we will discuss one such application – indicator-sysmonitor, which does just that for you. We’ll also discuss how you can use this application to display custom output.

Note: all examples discussed in this article have been tested on Ubuntu 14.04, and the application version used is 0.6.2-stable.

The Indicator-Sysmonitor application displays various system-related information on the panel. This information includes file system disk space usage, network activity, memory usage, CPU usage, and swap space usage. In addition, the application also allows you to run your own scripts and commands and have their outputs displayed on the panel.

Execute the following commands to download and install the application on your Ubuntu box:

sudo add-apt-repository ppa:fossfreedom/indicator-sysmonitor
sudo apt-get update
sudo apt-get install indicator-sysmonitor

You can also directly grab the .deb file from here.

Once the application is installed, you can run it by launching “System monitor indicator” from Dash.

As soon as you launch the application, you’ll see that the CPU and memory-related information is displayed on the panel (see image below).

ind-sysmon-default

This is the information that the app displays by default. To learn and understand what other information it can display, click on the panel where the information is being displayed and then click on Preferences.

ind-sysmon-preferences-option

This will bring up the following window:

ind-sysmon-pref-window

Click the Advanced tab and you’ll see all the available options:

ind-sysmon-available-options

It’s not difficult to understand that the text present in the “Customize output” box is responsible for the CPU and memory information that is displayed by default on the panel, and the “Sensors” section contains the complete list of system-monitoring parameters that you can use.

For example, suppose I want to display network-related information on the panel. So to do this, I’ll add the text network: {net} to the “Customize output” box:

ind-sysmon-add-network-info

Alternatively, you can also click the Add button present at the bottom right after selecting “net” in the “Sensors” box. Once done, click the Test button to see the effect (and Save to save the new setting). The output should be something like this:

ind-sysmon-net-info-displayed

So, you can see that the application output now contains network-related information. Similarly, you can add various available parameters to display and monitor information related to them.

The Indicator-Sysmonitor application also lets you display output of custom commands and scripts, which means that if you want to monitor the output of one of your scripts or a command, you can do that using this application. Here is a simple example:

Suppose you want to print the username associated with the current effective user ID on the panel. You can do that by adding the whoami command to the application. To do that click on the New button in the Advanced tab of the Preferences window, and in the window that pops up, enter a command identifier, its description, and the command itself in the three fields.

ind-sysmon-custom-command

Then click OK.

Now the command you just added will be available in the list of sensors.

ind-sysmon-new-command-added

Select that particular command and click the Add button.

ind-sysmon-whoami-active

Click the Test button, and you should see output similar to the following (obviously the username will be different in your case – in my case it’s “himanshu”).

ind-sysmon-whoami-output-panel

Similarly, you can also display output of your scripts. A good example of this can be viewed here.

Indicator-Sysmonitor is a simple application that is not only easy to understand but extensible. However, keep in mind that you cannot use it to display icons or tweak the font style and color of the output text. All in all, it’s worth giving it a try.