Bmon Stands is an open source tool for the bandwidth monitoring tool. bmon is a powerful CLI based network bandwidth monitoring and debugging tool for Unix / Linux systems to capture networking related statistics & present them visually on the command line in a human-friendly way. It captures the traffic usage over all the network interfaces on the system. It is an effective and fast real-time network bandwidth monitor and rate estimator.
It features various output methods such as :
- HTML output
- ASCII output
- Graphical visualization
- An interactive curses user interface
- A programmable text output for scripting
bmon installation in Linux:
It can be easily installed from the default package manager as almost all Linux distributions has bmon package in the default repositories but the available version might be a little older.
$ sudo yum install bmon
On Fedora 22+:
$ sudo dnf install bmon
$ sudo apt-get install bmon
On openSUSE system:
$ sudo zypper in bmon
On Arch Linux based systems:
$ pacman -S bmon
For the most recent version of bmon (i.e version 4.0), you have to build it from its source using the following commands for different Linux distros:
For Debian based systems :
$ git clone https://github.com/tgraf/bmon.git $ cd bmon $ sudo apt-get install build-essential make libconfuse-dev libnl-3-dev libnl-route-3-dev libncurses-dev pkg-config dh-autoreconf $ sudo ./autogen.sh $ sudo ./configure $ sudo make $ sudo make install $ bmon
For CentOS 6, RHEL based systems:
$ git clone https://github.com/tgraf/bmon.git $ cd bmon $ sudo yum install make libconfuse-devel libnl3-devel libnl-route3-devel ncurses-devel $ sudo ./autogen.sh $ sudo./configure $ sudo make $ sudo make install $ bmon
For OSX installation :
$ brew install bmon
Full help is provided through the following command :
$ bmon --help
Bandwidth Monitor ( BMON ) : Getting started
Running bmon to capture live bandwidth usage
After completing the bmon installation successfully via the help of above commands for different distros, just type the following command to run the bmon tool :
To view the quick reference of bmon as below press [Shift + ?] :
bmon shows only interface information by default. To load the graphics, enter g, i, or d (depending on the distro) for detailed graphical visualization of information.
Set the specific interface to display :
To monitor the enp1s0 network interface, we will use the flag -p to set policy defining which network interfaces to display as below :
$ bmon -p enp1s0
To see the result in bit per second instead of bytes per second, use the -b flag like so :
$ bmon -bp enp1s0
To define the intervals per second use -r flag as below :
$ bmon -r 2 -p enp1s0
To use bmon Input Modules :
- Netlink employs the Netlink protocol to collect interface and traffic control statistics from the kernel.
- By default, netlink is the input module.
- To explicitly set netlink as input module :
$ bmon -i netlink
- proc is used to read interface statistics from the /proc/net/dev file.
- It is considered a legacy interface
- It is offered for backward compatibly and also as a fallback module in case the Netlink interface is not available.
- To explicitly set proc as input module :
$ bmon -i proc
- dummy is the programmable input module for debugging & testing purposes.
- To explicitly set dummy as input module :
$ bmon -i dummy
- Null is used to disable the data collection.
$ bmon -i null
- To obtain more information about a specific module use the “help” flag with the input mode as below :
$ bmon -i dummy:help
To Use bmon Output Modules :
- curses is an interactive curses-based text user interface,
- It offers real-time rate estimations
- To get the graphical representation of each attribute curses output mode is used.
- By default, curses are the output mode.
- To get the output in curses :
$ bmon -o curses
- ascii is a straightforward, , human-readable and programmable text output.
- Can be used to display a list of interfaces, detailed counters, and graphs to the console.
- By default, it is the fallback output mode when curses are not available.
- To get output in ascii :
$ bmon -o ascii
- The format is a fully scriptable output mode.
- Meant for consumption by other programs i.e. we can use its output values at a later time in scripts/programs for analysis & other stuff.
- To get output in format mode :
$ bmon -o format
- To get interactive curses output with graph :
$ bmon -o curses:ngraph=2
- To obtain more information about a specific module use “help” flag with the output mode as below :
$ bmon -o ascii:help
- To get help or read more about bmon use the man page or “help” flag:
$ bmon --help
$ man bmon