⌚ June 16, 2014

Are you looking for a terminal-based network load monitor? Do you want to check if that download is really working — preferably with colored ASCII graphics?

Try slurm!

Slurm (version 0.4.0) shows network activity for a given interface. Total uploads and downloads are shown together in text and ASCII graphics. Data updates every second by default, and the graph scrolls from left to right according to network usage.

Not only does this program look “techie” in a terminal, but best of all is its name: slurm. With a name like that, it must be good!

“Look, Ma! I’m slurming the network!”

“Fire up the slurmer!”

“What time is it? It’s slurm time!”

“Gotta slurm’em all!”

The slurm man pages give no indication of what the word slurm stands for or means, but this is a fun name. Far more interesting than, say, “Terminal-based Network Load Monitor.”

(Actually, SLURM, in capital letters, is a Linux acronym meaning Simple Linux Utility for Resource Management, which refers to a job scheduler for Linux-based supercomputers — a completely different topic. For more information about SLURM in capital letters, have a look at the official SLURM web site: http://slurm.schedmd.com/)

The slurm (lower-case letters) we are looking at in this article, is understandable by the average Linux user and usable on everyday desktop systems.

Installing slurm

Slurm is available in the repositories. In Ubuntu/Xubuntu/Linux Mint, simply install from the command line or from Synaptic.

sudo apt-get install slurm

Running slurm

Unlike iftop, slurm does not require root permissions to run. At least not on any of the systems I tried. At a command prompt, simply specify the network device on which to listen.

Monitor a wireless network device

slurm -i wlan0

Monitor a wired NIC

slurm -i eth0

More options are available to customize the display, so consult the man pages for details. For now, these example commands will get you started quickly. Use the name of your specific network device. (Run ifconfig in a terminal to find out what network interfaces are available on your system.)

Slurm Display

Slurm occupies the entire terminal space, and it will continue to run until you press q to quit the program.

By default, slurm displays a split graph showing upload and download activity.

As far as I can tell, green indicates downloads (RX), and red indicates uploads (TX). Each vertical column, red or green, represents one second of time by default. The more green or red x’s that appear per column, the higher the network load at that given point in time.

The man pages provide no instructions about how to interpret the data, and the URL given in the man page yields a page not found. So, here are my thoughts based upon my usage.

Uploads and downloads are tracked independently of each other. Therefore, their graphs might appear as the same size even though the upload and download throughputs (MB/s or KB/s) might be drastically different.

In the example above, the size of both graphs (green and red) appear the same, but look at the RX/TX speeds reported. The download speed is much faster at ~974 KB/s while the upload speed is much slower at ~36 KB/s. Yet, both graphs appear about the same size.

The largest red column represents 36 KB/s, so all other red columns are sized in proportion to that. If a higher upload (TX) speed is recorded, than all of the existing red columns will resize to reflect the change. The same behavior applies to the green (RX) graph.

Again, there are no interpretation instructions given. Slurm behavior is based on testing and observation.

Slurm Statistics

Slurm does not show connections. It only reports network activity and records totals beginning from program startup. Stats are saved and resumed between program sessions. Closing the terminal, opening a new terminal, and opening slurm again will restore the stats per interface, so wlan0 stats are recorded separately from eth0 stats, for example. Stats are also preserved between logouts. However, slurm stats reset across system reboots.

Further slurm Display

To view network connections, use iftop.

Apparently, slurm monitors one network interface per terminal, so, to monitor multiple network interfaces, open multiple terminals and run slurm in each one for each network interface.

For increased techie-ness, open iftop in yet another terminal, and watch your network monitoring come alive!

Slurm Commands

According to the man page, a few keys will change slurm’s display in real time.

Here are a few commands that affect slurm as it runs:

c - Classic mode showing one graph s - Split graph mode showing uploads and downloads (default) l - Same as split graph, but larger. Some text omitted. L - TX/RX LED mode m - Cycle among classic (c), split (s), and large split (l) q - Quit

Conclusion

After using slurm for some time, it has earned its keep because this is a fun program for monitoring network activity. It is easy to use, simple to understand, and the colored ASCII graph adds a much-needed technical appearance to the desktop.

Given that this is a terminal program, it should be a simple matter to integrate it into Conky, a desklet, or another similar program. The possibilities are endless.

Besides, the green and red x’s look like Christmas lights scrolling across the terminal, and Christmas is always a good thing.