LinuxCommandLibrary

bmon

Monitor network bandwidth usage in real-time

TLDR

Display the list of all the interfaces

$ bmon [[-a|--show-all]]
copy

Display data transfer rates in bits per second
$ bmon [[-b|--use-bit]]
copy

Specify the policy to define which network interface(s) is/are displayed
$ bmon [[-p|--policy]] [interface_1,interface_2,interface_3]
copy

Specify the interval (in seconds) in which rate per counter is calculated
$ bmon [[-R|--rate-interval]] [2.0]
copy

SYNOPSIS

bmon [OPTIONS]

PARAMETERS

-i
    Specify the input module (e.g., netlink, proc, kstats) to gather network statistics.

-o
    Specify the output module (e.g., curses for interactive display, ascii, html, csv, json) for presenting data.

-p
    Specify the policy for interpreting values (e.g., avg, max, sum). Default is avg.

-r
    Set the refresh rate in milliseconds. The default is 500ms.

-f
    Filter network interfaces using glob patterns (e.g., eth*, lo) to monitor specific ones.

-s
    Set the history buffer size in packets. Default is 128 packets.

-B
    Set the history buffer size in seconds.

-l
    Enable link-layer output, showing statistics for ARP and NDP.

-P
    Display bandwidth usage as a percentage of interface capacity.

-a
    Display absolute values instead of rates (e.g., total bytes instead of bytes/sec).

-L
    List all available input and output modules.

-N
    Monitor a specific network interface by its name (e.g., eth0, enp0s3).

-u
    Specify the units for displayed rates (e.g., bits, bytes, bps, Bps).

-z
    Zero counters on startup, effectively resetting the displayed statistics from the moment bmon starts.

-h
    Display the help message and exit.

-v
    Display the version information and exit.

DESCRIPTION

bmon is a lightweight, real-time network monitoring and debugging tool for Linux. It provides detailed statistics of network interfaces, including received and transmitted bytes, packets, errors, and drop rates. Designed for command-line use, bmon leverages various input modules (like netlink or procfs) to gather data efficiently and supports multiple output formats. Users can choose from an interactive curses-based display, raw ascii, html, csv, or json data, making it versatile for both direct monitoring and integration into scripts or automation workflows. It's particularly useful for quickly identifying network bottlenecks or abnormal traffic patterns directly from the terminal.

CAVEATS

bmon has a few considerations:
- Requires root privileges or appropriate capabilities (CAP_NET_ADMIN, CAP_NET_RAW) for some input modules (e.g., netlink) to gather comprehensive statistics.
- Data accuracy depends on the underlying kernel's ability to provide timely and consistent statistics.
- The curses output module requires a terminal emulator that supports ncurses.
- May consume more CPU than simpler tools like iftop when history tracking is enabled with large buffers, or if refreshing very rapidly.

<B>INTERACTIVE CONTROLS (CURSES OUTPUT)</B>

When using the default curses output module, bmon offers several interactive controls:
?: Display help menu
d: Toggle detailed interface view
s: Toggle statistics view
g: Toggle graphs
a: Toggle absolute/rate values
p: Toggle percentages
h/j/k/l or arrow keys: Navigate between interfaces
+ or -: Adjust refresh rate
q or Esc: Quit bmon

HISTORY

bmon was created by Thomas Graf and initially released around 2005-2006 as a rewrite of an older bandwidth monitor. It aimed to provide a more modular and flexible architecture, allowing different input sources and output formats. Its development has focused on efficiency, providing real-time data with minimal overhead, and supporting modern Linux kernel interfaces for network statistics. It has been actively maintained and improved, integrating features like per-interface history, filtering, and various output options suitable for both interactive and automated monitoring scenarios.

SEE ALSO

iftop(8), nload(1), vnstat(1), netstat(8), ss(8), sar(1)

Copied to clipboard