Slurm: A Comprehensive Guide to the Lightweight Network Load Monitor
In the realm of system administration and network troubleshooting, real-time visibility into network traffic is critical. Whether you’re diagnosing bandwidth bottlenecks, verifying data transfer rates, or monitoring interface utilization, having a lightweight, efficient tool can make all the difference. Enter Slurm—a command-line network load monitor designed for simplicity, speed, and minimal resource consumption.
Note: This guide focuses on the network load monitor slurm by Matthias Schmitz, not to be confused with the Slurm Workload Manager (a job scheduler for high-performance computing clusters). While they share the same name, they serve entirely different purposes.
In this guide, we will explore Slurm's features, installation across multiple platforms, usage, best practices, and troubleshooting to help you master this powerful network monitoring tool.
Table of Contents#
- What is Slurm?
- Installation
- Basic Usage
- Advanced Features
- Common Practices
- Best Practices
- Troubleshooting
- Frequently Asked Questions (FAQ)
- Conclusion
- References
What is Slurm?#
Slurm is a Linux/BSD-based command-line tool for monitoring network interface traffic in real time. Originally a port of the Linux ppp link monitor called pppstatus by Gabriel Montenegro, it was later adapted by Hendrik Scholz and Matthias Schmitz into a generic network load monitor for *BSD, Linux, HP-UX, Solaris, and macOS.
Key Features:#
- Minimal resource footprint: Runs with low CPU/memory usage, making it suitable for resource-constrained systems.
- ASCII ncurses graphics: Three graph modes (combined RX/TX, split view, large split view).
- Single interface monitoring: Focuses on one network interface at a time.
- Theme support: Customizable ASCII themes.
Installation#
Slurm is available for most Linux distributions and other Unix-like systems via package managers. Below are installation instructions for common platforms:
Important Note: On Fedora/RHEL/CentOS systems, the slurm package in default repositories refers to the cluster workload manager, not this network monitor. For these systems, compile from source.
1. Debian/Ubuntu-based Systems#
Slurm is included in the default repositories for Debian (10+) and Ubuntu (18.04+). Install with apt:
sudo apt update && sudo apt install slurm2. Source Installation (For Other Distros)#
If Slurm isn’t available via your package manager (or for Fedora/RHEL), compile from source:
-
Install dependencies:
# Debian/Ubuntu: sudo apt install build-essential meson libncurses6-dev # Fedora/RHEL: sudo dnf install gcc make meson ncurses-devel -
Download the latest source code from the Slurm GitHub repo:
git clone https://github.com/mattthias/slurm.git cd slurm -
Compile and install:
meson setup _build cd _build/ meson compile sudo meson install
3. FreeBSD#
Slurm is available in the FreeBSD ports collection:
pkg install slurmOr compile from source after installing dependencies:
pkg install meson pkgconf ncurses4. macOS (via Homebrew or Source)#
Slurm supports macOS 12 (Monterey) and later. Compile from source:
brew install meson ncurses
git clone https://github.com/mattthias/slurm.git
cd slurm
meson setup _build
cd _build/
meson compile
sudo meson installBasic Usage#
Slurm requires specifying a network interface to monitor with the -i flag:
slurm -i eth0Default Output#
Slurm displays a live-updating ASCII graph showing network traffic for the selected interface. Three graph modes are available:
- Classic/combined: RX and TX traffic on a single graph
- Split: Separate graphs for RX and TX
- Large split: Larger separate graphs for RX and TX
Command-Line Options#
Slurm offers the following flags:
| Option | Description |
|---|---|
-i <iface> | Monitor a specific interface (required, e.g., slurm -i eth0). |
-c | Start with classic/combined graph mode. |
-s | Start with split graph mode. |
-l | Start with large split graph mode. |
-d <sec> | Set delay between screen updates in seconds (1-300, default: 1). |
-L | Add hostname to title. |
-z | Virtually zero traffic counters instead of using kernel values. |
-h | Display help menu. |
Platform note: Interface speed detection is only supported on *BSD systems.
Interactive Keyboard Commands#
While running, Slurm supports these keyboard commands:
| Key | Function |
|---|---|
c | Switch to classic/combined mode |
s | Switch to split graph mode |
l | Switch to large split graph mode |
L | Enable TX/RX LED |
m | Cycle between classic, split, and large views |
z | Zero traffic counters |
r | Redraw screen |
q | Quit Slurm |
Advanced Features#
Theme Support#
Slurm supports custom ASCII themes. Theme files can be found in /usr/share/slurm/themes/ or compiled with the source.
Statistics Persistence#
Slurm saves traffic statistics between sessions. When you quit and restart Slurm on the same interface, it resumes from the previous totals. Statistics are preserved across logouts but reset after system reboots.
Monitoring Multiple Interfaces#
Slurm monitors one interface per instance. To monitor multiple interfaces simultaneously, open separate terminal windows and run a Slurm instance in each one targeting a different interface.
Common Practices#
Slurm shines in scenarios where real-time, lightweight network monitoring is needed. Here are common use cases:
1. Troubleshooting Bandwidth Bottlenecks#
When users report slow network speeds, run Slurm to check if an interface is saturated:
slurm -i eth02. Verifying Data Transfers#
During large file transfers (e.g., backups, cloud sync), use Slurm to ensure throughput matches expectations.
3. Monitoring Embedded/Resource-Limited Devices#
Slurm’s low resource usage makes it ideal for routers, Raspberry Pi, or IoT devices.
Best Practices#
To get the most out of Slurm, follow these best practices:
1. Run with Appropriate Privileges#
Slurm requires read access to network interface stats. On most systems, non-root users can run Slurm, but some interfaces may require sudo.
2. Avoid Over-Monitoring#
Refreshing too frequently (e.g., -d 1 is default, use -d 5 or higher for low-traffic links).
3. Combine with Deep-Dive Tools#
Slurm shows how much traffic is flowing, but not what is flowing. For granular analysis, pair Slurm with tools like iftop or tcpdump.
4. Interpret the Graph Correctly#
The ASCII graph scales dynamically to the current traffic volume. A taller column means more activity relative to other displayed columns—not a fixed bandwidth value. Both RX (receive) and TX (transmit) graphs scale independently.
Troubleshooting#
1. "Required option -i missing" Error#
Slurm requires specifying an interface with -i. List available interfaces first:
ip link show # List all interfaces2. Slurm Doesn’t Show an Interface#
Verify the interface exists with:
ip link showIf the interface is down, bring it up first:
sudo ip link set wlan0 up3. No Traffic Data (All Zeros)#
- Ensure the interface is active (check for
UPstatus withip link show <iface>). - Verify the interface is connected (e.g., Ethernet cable plugged in, Wi-Fi associated).
Frequently Asked Questions (FAQ)#
Is Slurm the same as the Slurm Workload Manager?#
No. The network load monitor slurm (lowercase) by Matthias Schmitz is a lightweight ncurses-based traffic monitoring tool. The Slurm Workload Manager (uppercase SLURM) is a completely separate job scheduler for HPC clusters developed by SchedMD.
Does Slurm require root privileges?#
On most systems, non-root users can run Slurm without issues. However, some interfaces or configurations may require sudo.
Can Slurm monitor multiple interfaces at once?#
No. Slurm monitors one interface per instance. To monitor multiple interfaces, run separate Slurm instances in different terminal windows.
What is the difference between Slurm and iftop?#
Slurm shows aggregate traffic volume (how much data is flowing) with a visual graph. Iftop shows per-connection details (which hosts are communicating). Use Slurm for bandwidth overview and iftop for connection-level analysis.
Does Slurm work over SSH?#
Yes. Slurm works well over SSH sessions, making it useful for remote server monitoring.
Conclusion#
Slurm is a powerful, lightweight tool for real-time network monitoring. Its simplicity, low resource usage, and ASCII graph output make it a go-to choice for system admins, developers, and hobbyists alike. Whether you’re troubleshooting a slow network, verifying data transfers, or monitoring embedded devices, Slurm provides the insights you need without the overhead of heavier tools.