Baptiste Jonglez a3d894000b Use a monotonic clock instead of a realtime clock
Using a realtime clock is a bad idea: it is affected by any kind of time
change, which can happen when the administrator modifies the system time,
or more simply when a laptop suspends to RAM and then wakes up from sleep.

With the current approach of using a realtime clock:

- if the system time jumps forward (e.g. when resuming after a
  suspend-to-RAM), bmon would take 100% CPU and display random graph data
  extremely fast, until it "catches up" with the new time.

- if the system time jumps backwards, bmon would freeze until *time*
  "catches up" to the point it was before.  bmon then (incorrectly)
  displays a spike in the graph, because lots of packets have been
  sent/received since the last update.

Instead of using gettimeofday(), switch to clock_gettime() with
CLOCK_MONOTONIC on systems that support it.  OS X does not provide
clock_gettime(), so this commit also adds a Mach-specific implementation.

This change has been tested on Linux 4.1 with glibc and musl, and on
FreeBSD 10.0-RELEASE-p12.
2016-11-12 19:29:39 +01:00
2014-08-30 13:32:49 +02:00
2016-07-19 22:57:37 +02:00
2013-07-05 15:11:46 +02:00
2014-07-06 13:43:45 +02:00
2013-07-05 15:11:46 +02:00
2013-07-05 15:11:46 +02:00
2016-07-19 23:16:10 +02:00

bmon - Bandwidth Monitor

Build Status Coverity Status

bmon is a monitoring and debugging tool to capture networking related statistics and prepare them visually in a human friendly way. It features various output methods including an interactive curses user interface and a programmable text output for scripting.

Download

Debian/Ubuntu Installation

git clone https://github.com/tgraf/bmon.git
cd bmon
apt-get install build-essential make libconfuse-dev libnl-3-dev libnl-route-3-dev libncurses-dev pkg-config dh-autoreconf
./autogen.sh
./configure
make
make install
bmon

OSX Installation

Install libconfuse

wget https://github.com/martinh/libconfuse/releases/download/v2.8/confuse-2.8.zip
unzip confuse-2.8.zip && cd confuse-2.8
PATH=/usr/local/opt/gettext/bin:$PATH ./configure
make
make install

Install bmon

git clone https://github.com/tgraf/bmon.git
cd bmon
./autogen.sh
./configure
make
make install
bmon

New in 3.9

  • Color support
  • Add ability to reset statistics from curses UI
  • NetBSD compile fix
  • Option to enable info display by default
  • Additional IPv6 statistics
  • Various fixes

Usage

To run bmon in the default curses mode:

bmon

There are many other options available and full help is provided via:

bmon --help

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3

Various authors, see git commit log.

Copyright (c) 2001-2016 Thomas Graf tgraf@suug.ch Copyright (c) 2013 Red Hat, Inc.

Please see the LICENSE.BSD and LICENSE.MIT files for additional details.

Description
bandwidth monitor and rate estimator
Readme 931 KiB
Languages
C 87.6%
M4 11.9%
Makefile 0.4%