Skip to content

Issues #1 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 93 commits into
base: fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e2df502
Remove unused variables
tgraf Aug 24, 2014
68bd14f
Remove unused write_column() function
tgraf Aug 24, 2014
e3d2089
Initialize t to silence uninit warning
tgraf Aug 24, 2014
a36136e
Annotate unused variables
tgraf Aug 24, 2014
4492ab5
build: Enable -Wall
tgraf Aug 24, 2014
17a4adb
build: fail CI builds if a new warning is introduced
tgraf Aug 24, 2014
8b4ce86
Makefile: Fix README.md distribution inclusion
tgraf Aug 30, 2014
6920af8
travis: Run make distcheck
tgraf Aug 30, 2014
7f8d60f
3.5 release
tgraf Aug 30, 2014
c1d0bb4
Fix LICENSE links in README.md
tgraf Sep 5, 2014
c4ed01f
build: uclinux is also linux
gustavoz Nov 11, 2014
88548cc
Merge pull request #18 from gustavoz/master
tgraf Nov 13, 2014
baabc8b
3.6 release
tgraf Nov 22, 2014
ea065c5
Provide download link in README.md
tgraf Nov 22, 2014
0100916
BSD: Provide minimal interface information
tgraf Dec 16, 2014
511e019
Update README.md
halidaltuner Jan 8, 2015
3ecdad6
Update README.md
halidaltuner Jan 8, 2015
8fc5a55
Merge pull request #19 from halid/master
tgraf Jan 8, 2015
229d58c
using `cfg_setint` is triggering an assertion in confuse library, sho…
Chocobo1 Jan 19, 2015
234efb8
Merge pull request #20 from Chocobo1/dev
tgraf Apr 29, 2015
c1ae292
README: Mention ncurses-devel dependency in installation notes
tgraf Apr 29, 2015
2a410be
README: Mention that ./autogen.sh must be run after git clone
tgraf Apr 29, 2015
c80554b
Explicitly include linux/if.h to fix cross-compile error
tklauser Apr 30, 2015
4645116
Merge pull request #24 from tklauser/cross-compile-fix
tgraf Apr 30, 2015
5e61c5c
man page: add explaination of SI uints
Chocobo1 May 31, 2015
5cecc86
Fix inconsistency in format module example
Chocobo1 May 31, 2015
51a24c3
Fix wrong unit displayed when using "--use-bit" option
Chocobo1 May 31, 2015
2ccea2c
Merge pull request #25 from Chocobo1/bits
tgraf May 31, 2015
29172c8
Document -b option
tgraf Jun 30, 2015
21ec49e
format: Don't print error message for unavailable attributes
tgraf Jun 30, 2015
47547eb
man: Also mention --use-bit option
tgraf Jun 30, 2015
30946f2
bmon 3.7 release
tgraf Jun 30, 2015
2027a63
netlink: Only disable TC stats if QoS is not available in kernel
tgraf Jul 25, 2015
e31a860
Update copyright
tgraf Jul 25, 2015
964f484
3.8 release
tgraf Jul 25, 2015
665c63d
Add additional IPv6 link stats
tklauser Aug 4, 2015
9a69cb6
man: Fix --ouptut typo
tgraf Aug 9, 2015
559e31e
Merge pull request #30 from tklauser/ip6-link-stats
tgraf Nov 16, 2015
f666ffd
curses: Make float2str static
tgraf Dec 16, 2015
0641291
curses: Pass in proper NULL pointer
tgraf Dec 16, 2015
753a9e0
bmon: Remove dead code and make sig_exit() static
tgraf Dec 16, 2015
4488cd0
bmon: Properly pass NULL pointers instead of 0
tgraf Dec 16, 2015
892bdac
bmon: Mark attr_def_free() and __lookup_element() static
tgraf Dec 16, 2015
f9c714f
netlink: Use ifindex of parent TC object when searching leaf qdiscs
tgraf Dec 16, 2015
a0eea59
netlink: BUG() if we don't have parent information
tgraf Dec 16, 2015
8dcd666
travis: Switch to trusty ubuntu distro
tgraf Dec 16, 2015
cbcdab6
TravisCI: fix script, add OSX builds
Chocobo1 Jan 25, 2016
67b6ee3
TravisCI: merge config for coverity scan
Chocobo1 Jan 25, 2016
1f79ea4
Merge pull request #32 from Chocobo1/travis
tgraf Jan 25, 2016
4efaa8c
curses: Add ability to reset statistics
tgraf Jan 29, 2016
0103671
Check for presence of pkg-config in configure
tgraf Jan 29, 2016
fa6abf3
NetBSD does not have send or receive quotas.
bsiegert Mar 26, 2016
74770b8
Use uintmax_t cast for some printfs.
bsiegert Mar 26, 2016
0e08ec1
Merge pull request #36 from bsiegert/master
tgraf Mar 28, 2016
f78c0e5
Add 'info' option to show additional info screen by default
tgraf Mar 29, 2016
a6c635d
Update Readme to include additional dependencies
Berzerker Mar 29, 2016
70e6f97
Merge pull request #37 from Berzerker/patch-1
tgraf Mar 30, 2016
19c35e4
Add OSX install instructions
yamadapc Apr 20, 2016
cc22e4e
Merge pull request #38 from yamadapc/master
tgraf Apr 20, 2016
f177718
format: Add missing braces around 'if' clause
tklauser Apr 28, 2016
1c25eac
Merge pull request #39 from tklauser/gcc-6
tgraf Apr 28, 2016
828b5b5
enabling colors for bmon
Jul 15, 2016
e47a376
fix make distcheck error
Jul 19, 2016
8f39217
Merge branch 'blastmaster-master'
tgraf Jul 19, 2016
df271c4
3.9 release
tgraf Jul 19, 2016
ddcd5e7
Derive initial interface selection based on policy
tgraf Aug 2, 2016
723f6a5
dummy: Use default group as first group name
tgraf Aug 2, 2016
86f6da0
Use DEFAULT_GROUP instead of hardcoded string
tgraf Aug 2, 2016
7317715
Fix item selection after element subgroups have been removed
tgraf Aug 2, 2016
702df3c
Fix issue #43
Aug 4, 2016
5cd24ff
Merge pull request #44 from blastmaster/master
tgraf Aug 5, 2016
5b938e0
Added a format string example to the man page. While the documentatio…
freshdresch Oct 7, 2016
5771128
Replaced format string double quotes with single quotes to prevent th…
freshdresch Oct 7, 2016
32d8c76
Changed the long format string example to be one continuous string. W…
freshdresch Oct 7, 2016
29fb431
Merge pull request #48 from DoctorSher/master
tgraf Oct 7, 2016
a530134
Flushed stdout after every group is printed in an iteration. This all…
freshdresch Oct 17, 2016
8b2638c
Merge pull request #49 from DoctorSher/master
tgraf Oct 18, 2016
a3d8940
Use a monotonic clock instead of a realtime clock
Sep 5, 2016
2efc2f4
Merge pull request #46 from zorun/monotonic_clock
tgraf Nov 25, 2016
f312679
Added CentOS installation steps
Nov 28, 2016
3e49704
Merge pull request #51 from L00Cyph3r/patch-1
tgraf Nov 28, 2016
af8923b
netlink: Add rx_nohandler link stat counter
tklauser Dec 13, 2016
1b3f11b
4.0 release
tgraf Dec 13, 2016
3413751
out_curses: use xcalloc instead of a fixed buffer
NachiP Jan 31, 2017
14db0bf
Avoid trying to include <values.h> on Android
fornwall Feb 9, 2017
49ce252
OSX: Add brew usage instructions
tgraf Feb 10, 2017
fdd139a
Fix configuration syntax in examples/bmon.conf
tgraf Feb 10, 2017
b44d015
Allow numeric colors in bmonrc
afh Oct 2, 2017
737c642
Fix typographical errors
afh Oct 3, 2017
ed8528c
curses: Fix seperator lines
afh Oct 3, 2017
5677863
curses: Add CTRL-N/CTRL-P for next/previous element
afh Oct 2, 2017
169332b
Add package installation instructions for Fedora/CentOS
carlwgeorge Oct 15, 2019
def45f5
Fix build in FreeBSD/DragonflyBSD
farrokhi Nov 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
language: c

os:
- linux
- osx

env:
global:
- secure: "C87Pgf5AVDoyQfm9MIv81g"

compiler:
- gcc
- clang
before_install:
- sudo apt-get install libconfuse-dev
- sudo apt-get install libnl-3-dev libnl-route-3-dev
- sudo apt-get install libncurses-dev
# Change this to your needs
script: ./autogen.sh && ./configure && make

# container-based builds
sudo: false
addons:
apt:
packages:
# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
- libconfuse-dev
- libncurses5-dev
- libnl-3-dev
- libnl-route-3-dev
coverity_scan:
project:
name: "tgraf/bmon"
description: "bandwidth monitor"
notification_email: [email protected]
build_command_prepend: "./autogen.sh && ./configure"
build_command: "make -j2"
branch_pattern: coverity_scan


install:
- if [ "$TRAVIS_BRANCH" = "coverity_scan" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" ]; then exit ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update > /dev/null && brew install confuse ; fi

script:
- ./.travis/run.sh
9 changes: 9 additions & 0 deletions .travis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

FLAGS="-Werror"

if [ $CC = "clang" ]; then
FLAGS="$FLAGS -Wno-error=unused-command-line-argument"
fi

./autogen.sh && ./configure && make CFLAGS="$FLAGS" && make distcheck
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ ACLOCAL_AMFLAGS = -I m4

SUBDIRS = src man include examples

EXTRA_DIST = ChangeLog LICENSE.BSD LICENSE.MIT NEWS README.adoc
EXTRA_DIST = ChangeLog LICENSE.BSD LICENSE.MIT NEWS README.md
38 changes: 36 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
HEAD

v4.0 - Dec 13, 2016
* Use monotonic clock instead of realtime clock
* Pick default selected interface based on policy
* Collect RX NoHandler statistics if available (Linux)
* CentOS installation instructions
* Proper stdout flush in ASCII mode
* Bugfixes

v3.9 - Jul 19, 2016
* 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

v3.8 - July 25, 2015
* Don't disable Netlink if TC stats are unavailable

v3.7 - November 22, 2014
* Bugfixes
* Documentation updates
* Provide minimal interface information on BSD

v3.6 - November 22, 2014
* Build fix for uclinux
* Fix LICENSE links

v3.5 - August 30, 2014
* Fixes for all defects identified by coverity
* Fix accuracy issue on total rate calculation
* Travis-CI support
* Various other small bugfixes

v3.4 - August 24, 2014
----------------------
* Bugfixes
* blank screen with config file
* quick-help toggle with '?' in curses
* Better bmon.conf example

v3.3 - July 6, 2014
-------------------
* MacOS X port
* Only initialize curses module if actually used
* Assorted bug and spelling fixes
Expand Down
106 changes: 88 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,86 @@ 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.

## Changes

### New in 3.4
## Download

* [Latest Release](https://github.com/tgraf/bmon/releases/latest)
* [Older Releases](https://github.com/tgraf/bmon/releases)

## 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
```
## CentOS 6 Installation

```
git clone https://github.com/tgraf/bmon.git
cd bmon
yum install make libconfuse-devel libnl3-devel libnl-route3-devel ncurses-devel
./autogen.sh
./configure
make
make install
bmon
```

## CentOS 7 Installation

```
yum install bmon
```

## Fedora Installation

```
dnf install bmon
```

## OSX Installation

### Brew
```
brew install bmon
```

### Compile yourself
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 4.0
* Use monotonic clock instead of realtime clock
* Pick default selected interface based on policy
* Collect RX NoHandler statistics if available (Linux)
* CentOS installation instructions
* Proper stdout flush in ASCII mode
* Bugfixes
* blank screen with config file
* quick-help toggle with '?' in curses
* Better bmon.conf example

## New in 3.3
* MacOS X port
* Only initialize curses module if actually used
* Assorted bug and spelling fixes
* Various build fixes

-------------
### Usage

To run bmon in the default curses mode:
Expand All @@ -35,14 +101,18 @@ provided via:

## Screenshots

![Screenshot 1](https://github.com/tgraf/bmon/raw/gh-pages/images/shot1.png)
![Screenshot 2](https://github.com/tgraf/bmon/raw/gh-pages/images/shot2.png)
![Screenshot 1](https://github.com/tgraf/bmon/raw/gh-pages/images/shot3.png)
![Screenshot 2](https://github.com/tgraf/bmon/raw/gh-pages/images/shot1.png)
![Screenshot 3](https://github.com/tgraf/bmon/raw/gh-pages/images/shot2.png)

## Copyright

> *Copyright (c) 2001-2014 Thomas Graf <[email protected]>
> Copyright (c) 2013 Red Hat, Inc.*
Various authors, see git commit log.

> *Copyright (c) 2001-2016 Thomas Graf <[email protected]>*
> *Copyright (c) 2013 Red Hat, Inc.*

Please see the [LICENSE](https://github.com/tgraf/bmon/blob/master/LICENSE)
file for additional details.
Please see the [LICENSE.BSD](https://github.com/tgraf/bmon/blob/master/LICENSE.BSD)
and [LICENSE.MIT](https://github.com/tgraf/bmon/blob/master/LICENSE.MIT) files for
additional details.

21 changes: 16 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# configure.in Configure Script
#
# Copyright (c) 2001-2013 Thomas Graf <[email protected]>
# Copyright (c) 2001-2016 Thomas Graf <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -21,7 +21,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

AC_INIT(bmon, 3.4, [], [], [http://www.infradead.org/~tgr/bmon/])
AC_INIT(bmon, 4.0, [], [], [https://github.com/tgraf/bmon])
AC_CONFIG_HEADERS(include/bmon/defs.h)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -58,10 +58,18 @@ AC_CHECK_HEADERS(sys/param.h sys/socket.h)

AC_CHECK_TYPES(suseconds_t)

AC_CHECK_FUNCS(atexit gettimeofday memset pow socket strcasecmp)
AC_CHECK_FUNCS(atexit clock_gettime memset pow socket strcasecmp)
AC_CHECK_FUNCS(strchr strdup strerror strncasecmp strstr strtol)
AC_CHECK_FUNCS(uname getdate)

AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
AS_IF([test "x$PKG_CONFIG" = "xno"],[
AC_MSG_ERROR([
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.])
])

AX_WITH_CURSES
if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
Expand All @@ -70,14 +78,17 @@ fi
PKG_CHECK_MODULES([CONFUSE], [libconfuse], [], AC_MSG_ERROR([requires libconfuse]))

case ${target_os} in
linux*)
linux*|uclinux*)
PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [], AC_MSG_ERROR([requires libnl3-dev]))
PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0], [], AC_MSG_ERROR([requires libnl3-route]))
;;
esac

AC_CHECK_LIB(m, pow, [], AC_MSG_ERROR([requires libm]))

# Don't fail if not found (for instance, OS X does not have clock_gettime)
AC_CHECK_LIB(rt, clock_gettime, [], [])

BMON_LIB=""

#####################################################################
Expand Down Expand Up @@ -164,7 +175,7 @@ case ${target_os} in
AC_DEFINE_UNQUOTED(SYS_SUNOS, "1", [operating system])
;;

*bsd*)
*bsd*|dragonfly*)
AC_DEFINE_UNQUOTED(SYS_BSD, "1", [operating system])
;;

Expand Down
32 changes: 28 additions & 4 deletions examples/bmon.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

/*
* element eth0 {
* description = { "My description" }
* rxmax = { 10000 }
* txmax = { 10000 }
* max = { 12500000 }
* description = "My description"
* rxmax = 10000
* txmax = 10000
* max = 12500000
* }
*/

Expand Down Expand Up @@ -86,3 +86,27 @@ history day {
interval = 86400.
size = 60
}

layout colors {
color default {
color_pair = {"white", "black"}
}
color statusbar {
color_pair = {"blue", "white", "reverse"}
}
color header {
color_pair = {"yellow", "black"}
}
color list {
color_pair = {"white", "black"}
}
color selected {
color_pair = {"white", "black", "reverse"}
}
color RX_graph {
color_pair = {"green", "black"}
}
color TX_graph {
color_pair = {"red", "black"}
}
}
1 change: 1 addition & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ noinst_HEADERS = \
bmon/module.h \
bmon/output.h \
bmon/unit.h \
bmon/layout.h \
bmon/utils.h
6 changes: 6 additions & 0 deletions include/bmon/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ struct rate
/* Value of r_current at last read */
uint64_t r_prev;

/* Reset value to substract to emulate statistics reset */
uint64_t r_reset;

/* Rate per second calculated every `rate_interval' */
float r_rate;

/* Time of last calculation */
timestamp_t r_last_calc;
};

extern uint64_t rate_get_total(struct rate *);

enum {
ATTR_TYPE_UNSPEC,
ATTR_TYPE_COUNTER,
Expand Down Expand Up @@ -134,5 +139,6 @@ extern struct attr * attr_select_prev(void);
extern struct attr * attr_current(void);

extern void attr_start_collecting_history(struct attr *);
extern void attr_reset_counter(struct attr *a);

#endif
2 changes: 2 additions & 0 deletions include/bmon/bmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ enum {
#if defined __GNUC__
#define __init __attribute__ ((constructor))
#define __exit __attribute__ ((destructor))
#define __unused__ __attribute__ ((unused))
#else
#define __init
#define __exit
#define __unused__
#endif

#ifdef DEBUG
Expand Down
2 changes: 2 additions & 0 deletions include/bmon/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ enum {
LAYOUT_HEADER,
LAYOUT_LIST,
LAYOUT_SELECTED,
LAYOUT_RX_GRAPH,
LAYOUT_TX_GRAPH,
__LAYOUT_MAX
};

Expand Down
Loading