bmon is a simple yet powerful, text-based network monitoring and debugging tool for Unix-like systems, which captures networking related statistics and displays them visually in a human friendly format. It is a reliable and...

bmon is a simple yet powerful, text-based network monitoring and debugging tool for Unix-like systems, which captures networking related statistics and displays them visually in a human friendly format. It is a reliable and effective real-time bandwidth monitor and rate estimator.

It can read input using an assortment of input modules and presents output in various output modes, including an interactive curses user interface as well as a programmable text output for scripting purposes.

Suggested Read: 20 Command Line Tools to Monitor Linux Performance

Install bmon Bandwidth Monitoring Tool in Linux

Almost all Linux distributions has bmon package in the default repositories and can be easily install from default package manger, but the available version might be little older.

To view statistics of a given interface, select it using the Up and Down arrows. However, to monitor a specific interface only, specify it as an argument on the command line as follows.

Suggested Read: 13 Tools to Monitor Linux Performance

The flag -p sets a policy defining which network interfaces to display, in the example below, we will be monitoring the enp1s0 network interface:

$ bmon -p enp1s0

bmon – Monitor Ethernet Bandwidth

To use bit per second instead of bytes per second, use the -b flag like so:

$ bmon -bp enp1s0

We can also define the intervals per second with the -r flag as follows:

$ bmon -r 5 -p enp1s0

How to Use bmon Input Modules

bmon has a number of input modules that offer statistical data about interfaces, which includes:

netlink – employs the Netlink protocol to collect interface and traffic control statistics from the kernel. This is the default input module.

proc — reads interface statistics from the /proc/net/dev file. It is considered a legacy interface and offered for backwards compatibly. It is a fallback module in case the Netlink interface is not available.

dummy – this is a programmable input module for debugging and testing purposes.

null – disables data collection.

To find additional info about a module, invoke the it with the “help” option set as follows:

$ bmon -i netlink:help

The next command will invoke bmon with the proc input module enabled:

$ bmon -i proc -p enp1s0

How to Use bmon Output Modules

bmon also uses output modules to display or export the statistical data collected by the input modules above, which includes:

curses – this is an interactive curses based text user interface, it offers real time rate estimations and a graphical representation of each attribute. It is the default output mode.

ascii – is a straightforward programmable text output meant for human consumption. It can display list of interfaces, detailed counters and graphs to the console. It is the default fallback output mode when curses is not available.

format – is a fully scriptable output mode, it’s meant for consumption by other programs-meaning we can use its output values at a later time in scripts or programs for analysis and more.

null – this disables output.

To get more info concerning a module, run the it with the “help” flag set like so:

$ bmon -o curses:help

The command that follows will invoke bmon in ascii output mode:

$ bmon -p enp1s0 -o ascii

bmon – Ascii Output Mode

We can run the format output module as well, then use the values obtained for scripting or in another program: