Scroll to navigation

bwm-ng(1) Bandwidth Monitor NG bwm-ng(1)

NAME

bwm-ng - Bandwidth Monitor NG (Next Generation), a live bandwidth monitor for network and disk io.

SYNOPSIS

bwm-ng [options] ... [configfile]

DESCRIPTION

bwm-ng can be used to monitor the current bandwidth of all or some specific network interfaces or disks (or partitions). It shows total of in and out as well as total of all interfaces/devices. Several different output methods are supported (curses, curses2, plain, csv and html).

bwm-ng is not limited in the number of interfaces or disks and can handle new ones dynamically while its running or hide those which are not up.

INPUT METHODS

The input methods used pretty much depends on your OS and system. You can choose the preferred method either at start or in curses during run-time. Each method can only be used if bwm-ng was compiled with support for it.

Currently supported network input methods:

This is the default for Linux based systems. It parses the special procfs file /proc/net/dev. This should be used if in doubt in Linux.
This is the default on BSD systems like FreeBSD, NetBSD, OpenBSD and recent Mac OS X (>=10.3). This should be used if in doubt on those systems. It uses the getifaddrs systemcall.
This is the default for Solaris. It uses the kstat systemcall.
This is the default on Systems like IRIX and other UNIX. It can be used on many other systems like early Mac OS X as well. It uses the sysctl systemcall.
This is a Backup for systems without the above, or other problems.
bwm-ng can use the external library libstatgrab to gather the data. please refer to http://www.i-scream.org/libstatgrab for more info about this.

Currently supported disk input methods:

Shows the diskio on Linux 2.6+ systems using /proc/diskstats. Instead of packets the number of read/writes will be shown.
same as kstat network input but for disk io. It uses the kstat systemcall from Solaris.
Written for NetBSD and OpenBSD, but maybe working on other Platforms aswell.
devstat library based input. You can find this on FreeBSD based systems.
framework IOKit based input. You can find this on Darwin systems like MacOSX.
same as libstatgrab but for disk io (http://www.i-scream.org/libstatgrab/).

OUTPUT METHODS

You can select several different ways to output the data gathered by bwm-ng.

You can use one of:

This is the default output method. Usually this fits you the most. In curses mode you can control bwm-ng with several keys. Press 'h' for a online help. To quit using this mode either press 'q' or ctrl-c.
Shows bar charts of the current IO, using curses output.
Plain or ASCII is mostly a backup if curses is not available. You cannot control bwm-ng at all in this mode. To quit press ctrl-c. But for one single single output using this is the mode that fits the best.
CSV is designed to use with scripts for easy parsing.

Type rate:

unix timestamp;iface_name;bytes_out/s;bytes_in/s;bytes_total/s;bytes_in;bytes_out;packets_out/s;packets_in/s;packets_total/s;packets_in;packets_out;errors_out/s;errors_in/s;errors_in;errors_out\n

Type svg, sum, max:

unix timestamp;iface_name;bytes_out;bytes_in;bytes_total;packets_out;packets_in;packets_total;errors_out;errors_in\n

To skip the first output with only zeros use:

bwm-ng -o csv -c 0
This is designed for use in the WWW. It uses the CSS file bwm-ng.css in current working dir. "--htmlrefresh" only affects the refresh of the page by the browser. For best results use the same value for --timeout and --htmlrefresh.

OPTIONS

The options that are recognized by bwm-ng can be divided into 3 different groups. The long versions can only be used if bwm-ng was compiled with getopt_long.

INPUT

These options specify the method to gather the data as well as different options for them.

selects which method to use. It can be one of the above (see INPUT METHODS) if support for it was compiled in.
selects the file to parse in proc input method. This is usually /proc/net/dev.
selects the file to parse in disk input method. This is usually /proc/diskstats.
selects the file to parse in disk input method on older Kernel. This is usually /proc/partitions.
specifies the binary to execute for netstat input method. Because this may be a security flaw support for this option is not compiled in bwm-ng by default.

OUTPUT

These options select the way to output the data and several options for the output.

selects which method to use for output. It can be one of the above (see OUTPUT METHODS) if support for it was compiled in.
selects which unit to show. It can be one of bytes, bits, packets or errors.
specifies the type of stats to show. Use one of rate for the current rate/s, max for the maximal value achieved since startup of bwm-ng, sum for the total sum counted since startup of bwm-ng or avg for the average over the last 30 seconds.
number of outputs for Plain and CSV output mode. Use '1' for once single output. Using '0' in CSV mode will skip first output that always consists of zero values.
specifies the delimiter char for CSV mode. The default is ';'.
specifies the use of a outfile instead of stdout. This option only affects CSV and HTML mode.
sets the HTML Meta refresh field to seconds in HTML mode. This will result in a reload of the page every n seconds by the browser. If this is set you want to use --htmlheader as well.
if this option is used, bwm-ng will print the correct HTML header (<html></html>) including Meta fields before and after data. This is only useful in HTML mode. value can be 0 (off) or 1 (on), if the value is not given '1' is used.
disable ANSI Codes for Plain output.
show long realnames of disks in Darwin (ioservice input)

OTHER

These options specify the general behavior of bwm-ng.

displays and gathers stats every n msec (1msec = 1/1000sec). The default is 500msec.
shows bytes and bits with dynamic unit like K, M or G (Kilo, Mega, Giga). value can be 0 (off) or 1 (on), without a value '1' is used.
specifies whether only up and selected interfaces (mode=0), all which are up but maybe not selected (mode=1) or all, even down and not selected interfaces (mode=2). If no interface list given (--interfaces) mode=1 and mode=2 are the same.
show only interfaces which are in this comma separated list (whitelist). If the list is prefixed by a '%' its meaning is negated and interfaces in this list are hidden from output (blacklist). (Example: %eth0,tun0)
if given and the optional value is not 0, count also hidden and not shown interfaces for total value.
sets the span in which the stats for average mode are collected. Default is 30 seconds or 2*timeout.
fork into background and daemonize if given and the optional value is not 0. This only affects HTML and CSV mode and --outfile is required.
show a help of command line options.
print version info

CONFIGFILE

The behavior of bwm-ng can be also controlled by a configfile. By default bwm-ng first reads /etc/bwm-ng.conf and then ~/.bwm-ng.conf. If specified on command line bwm-ng skips those. It consists of the same long-options as used for command line as keys followed by a '=' and the value. Lines starting with a # or unknown key will be ignored.

For example:

DYNAMIC=1
UNIT=bits
PROCFILE=/proc/net/dev
OUTPUT=plain

OTHER FILES

bwm-ng.css the CSS file used for html output.

SEE ALSO

bwm-ng.conf-example for an example of the configfile, README for other comments and hints about bwm-ng.
http://www.gropp.org/ for new version or further help and links.

AUTHORS

Volker Gropp <bwmng@gropp.org> wrote bwm-ng and is current maintainer.
For further Authors please refer to AUTHORS file which should come with bwm-ng.

2007-03-01