Giter Site home page Giter Site logo

bmon's Introduction

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

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

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

Copyright

Various authors, see git commit log.

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

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

bmon's People

Contributors

afh avatar berzerker avatar bsiegert avatar carlwgeorge avatar chocobo1 avatar farrokhi avatar fornwall avatar freshdresch avatar gustavoz avatar halidaltuner avatar motoko-kusanagi avatar nachip avatar onlyjob avatar tgraf avatar tklauser avatar valinskas avatar yamadapc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bmon's Issues

SEGFAULT in __GI__IO_default_xsputn on Arch Linux

The segfault takes place with the latest git master intermittently when the network has high load. I suspect it has something to do with the number of codel classes.

#0  0x00007f095ebfa7a3 in __GI__IO_default_xsputn () from /usr/lib/libc.so.6
#1  0x00007f095ebcbfdc in vfprintf () from /usr/lib/libc.so.6
#2  0x00007f095ebcede6 in buffered_vfprintf () from /usr/lib/libc.so.6
#3  0x00007f095ebcc1ce in vfprintf () from /usr/lib/libc.so.6
#4  0x00007f095ec840c6 in __fprintf_chk () from /usr/lib/libc.so.6
#5  0x00005625c5d1a2e7 in fprintf (__fmt=0x5625c5d24110 "[DBG] %20s:%-4u %s: Creating element %d \"%s\"\n", __stream=<optimized out>) at /usr/include/bits/stdio2.h:97
#6  element_lookup (group=0x5625c6e9f640, name=name@entry=0x7ffe91604e00 "qdisc none (fq_codel)", id=id@entry=0, parent=0x5625d25739c0, flags=flags@entry=1) at element.c:155
#7  0x00005625c5d1cd2a in handle_tc_obj (tc=tc@entry=0x5625c6f6e5e0, prefix=prefix@entry=0x5625c5d25237 "qdisc", rdata=0x7ffe91604f50) at in_netlink.c:564
#8  0x00005625c5d1d024 in handle_qdisc (obj=0x5625c6f6e5e0, arg=<optimized out>) at in_netlink.c:670
#9  0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#10 0x00005625c5d1d19d in find_qdiscs (rdata=0x7ffe91604f50, parent=3, ifindex=2) at in_netlink.c:627
#11 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#12 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#13 0x00005625c5d1cba8 in find_classes (parent=0, rdata=0x7ffe91605020) at in_netlink.c:654
#14 0x00005625c5d1d073 in handle_qdisc (obj=0x5625c6f6e5e0, arg=<optimized out>) at in_netlink.c:682
#15 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#16 0x00005625c5d1d19d in find_qdiscs (rdata=0x7ffe916050c0, parent=3, ifindex=2) at in_netlink.c:627
#17 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#18 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#19 0x00005625c5d1cba8 in find_classes (parent=0, rdata=0x7ffe91605190) at in_netlink.c:654
#20 0x00005625c5d1d073 in handle_qdisc (obj=0x5625c6f6e5e0, arg=<optimized out>) at in_netlink.c:682
#21 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#22 0x00005625c5d1d19d in find_qdiscs (rdata=0x7ffe91605230, parent=3, ifindex=2) at in_netlink.c:627
#23 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#24 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#25 0x00005625c5d1cba8 in find_classes (parent=0, rdata=0x7ffe91605300) at in_netlink.c:654
#26 0x00005625c5d1d073 in handle_qdisc (obj=0x5625c6f6e5e0, arg=<optimized out>) at in_netlink.c:682
#27 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#28 0x00005625c5d1d19d in find_qdiscs (rdata=0x7ffe916053a0, parent=3, ifindex=2) at in_netlink.c:627
#29 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#30 0x00007f095f70c0c8 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
---- snip ----

Core dump can be downloaded from here: https://petko.me/bmon/bmon.core.xz

`__unused__` macro causes naming conflict with Xcode 12

  CC       bmon-utils.o
In file included from utils.c:31:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h:113:34: error: use of undeclared identifier 'unused'
__NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x)
                                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:161:40: note: expanded from macro '__unused'
#define __unused        __attribute__((__unused__))
                                       ^
../include/bmon/bmon.h:63:36: note: expanded from macro '__unused__'
#define __unused__ __attribute__ ((unused))
                                   ^

Looking in bmon.h:

#if defined __GNUC__
#define __init __attribute__ ((constructor))
#define __exit __attribute__ ((destructor))
#define __unused__ __attribute__ ((unused))
#else
#define __init
#define __exit
#define __unused__
#endif

Probably those macros should be renamed to something like ATTRIBUTE_UNUSED etc or something. Identifiers with double underscores are reserved for the compiler and system headers so you're always at risk of a clash if you use them yourself: https://stackoverflow.com/a/228797

Which files are under the BSD license?

Hi,
I'm packaging bmon for GuixSD. I have a doubt regarding the license of this package.

As far as I can tell, all the source files have MIT license headers. Which files are under the 2-clause BSD license?

Update Build Instructions

Dependencies:

  • On Ubuntu 14.04 Desktop I also needed to run "apt-get install libncurses-dev" in order for "./configure" to complete successfully.

Installation:

  • No mention of running "./autogen.sh" before attempting to run "./configure".

`bmon -o ascii:quitafter=1` returns nil because of a lack of samples

Example:

# bmon -o ascii:quitafter=1 -p eth0
Interfaces                               RX bps         pps      %    TX bps         pps      %
  eth0                                        0           0                0           0

This helps:

# bmon -o ascii:quitafter=2 -p eth0
Interfaces                               RX bps         pps      %    TX bps         pps      %
  eth0                                        0           0                0           0
Interfaces                               RX bps         pps      %    TX bps         pps      %
  eth0                                     1.29KiB        1              208B          1

None of the options (-r, -s) seem to allow you to set the elapsed sample time before calculating the result.

Use unicode ▄ and █ for the graphical statistics instead of "|" and ":"

There are a number of symbols that can be used for the graph with the reasonable expectation they'd be supported on most terminals currently available. This specific substitution should be relatively trivial. Further enhancements could be using the range between ▁ and █ for more precise graph or the upcoming Unicode 13 smoothed sextant chars for a slightly less precise graph that'd look a bit better.

The VTE folk is already working on supporting the UC13 symbols directly without reliance on special font support, but the downside is that these are not supported by older terminal programs.

FTBFS on kFreeBSD and GNU Hurd

Bmon-3.1 requires libnl which is not available on some architectures [GNU Hurd, kFreeBSD-i386, kFreeBSD-amd64].
Previous versions of bmon were possible to build without libnl.
Does bmon have any future on those architectures?

bmon 3.6 on OSX 10.10.3

Dear Thomas,

Please find enclosed the logs obtained compiling bmon on OSX 10.10.3.

Yours sincerely,

Notes:

https://github.com/tgraf/bmon/releases/download/v3.6/bmon-3.6.tar.gz

clang -v
clang version 3.6.1 (tags/RELEASE_361/final)
Target: x86_64-apple-darwin14.3.0
Thread model: posix

configure stdout:

checking build system type... x86_64-apple-darwin14.3.0
checking host system type... x86_64-apple-darwin14.3.0
checking target system type... x86_64-apple-darwin14.3.0
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... /opt/llvm/bin/clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/llvm/bin/clang accepts -g... yes
checking for /opt/llvm/bin/clang option to accept ISO C89... none needed
checking dependency style of /opt/llvm/bin/clang... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) /opt/llvm/bin/clang
checking whether we are using the GNU C compiler... (cached) yes
checking whether /opt/llvm/bin/clang accepts -g... (cached) yes
checking for /opt/llvm/bin/clang option to accept ISO C89... (cached) none needed
checking dependency style of /opt/llvm/bin/clang... (cached) gcc3
checking for /opt/llvm/bin/clang option to accept ISO C99... none needed
checking for /opt/llvm/bin/clang option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... /opt/llvm/bin/clang -E
checking whether make sets $(MAKE)... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking return type of signal handlers... void
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ncurses/ncurses.h usability... no
checking ncurses/ncurses.h presence... no
checking for ncurses/ncurses.h... no
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking sys/sockio.h usability... yes
checking sys/sockio.h presence... yes
checking for sys/sockio.h... yes
checking netinet6/in6.h usability... no
checking netinet6/in6.h presence... no
checking for netinet6/in6.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sysctl/ioctl.h usability... no
checking sysctl/ioctl.h presence... no
checking for sysctl/ioctl.h... no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for suseconds_t... yes
checking for atexit... yes
checking for gettimeofday... yes
checking for memset... yes
checking for pow... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtol... yes
checking for uname... yes
checking for getdate... yes
checking for NcursesW wide-character library... no
checking for Ncurses library... yes
checking for working ncurses/curses.h... no
checking for working ncurses.h... yes
checking for pkg-config... /opt/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for CONFUSE... yes
checking for pow in -lm... yes
checking for initscr in -lncurses... yes
checking for redrawwin in -lncurses... yes
checking for use_default_colors in -lncurses... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating examples/Makefile
config.status: creating include/bmon/defs.h
config.status: executing depfiles commands

configure stderr:

empty

compiler's stdout:

Making all in src
CC bmon-utils.o
CC bmon-unit.o
CC bmon-conf.o
CC bmon-input.o
CC bmon-output.o
CC bmon-group.o
CC bmon-element.o
CC bmon-attr.o
CC bmon-element_cfg.o
CC bmon-history.o
CC bmon-graph.o
CC bmon-bmon.o
CC bmon-module.o
CC bmon-in_netlink.o
CC bmon-in_null.o
CC bmon-in_dummy.o
CC bmon-in_proc.o
CC bmon-in_sysctl.o
CC bmon-out_null.o
CC bmon-out_format.o
CC bmon-out_ascii.o
CC bmon-out_curses.o
CCLD bmon

compiler's stderr:

Undefined symbols for architecture x86_64:
"_cfg_free", referenced from:
_conf_shutdown in bmon-conf.o
(maybe you meant: _element_cfg_free)
"_cfg_getbool", referenced from:
_unit_divisor in bmon-unit.o
_conf_init_post in bmon-conf.o
_configfile_read_attrs in bmon-conf.o
_configfile_read_element_cfg in bmon-conf.o
"_cfg_getfloat", referenced from:
_conf_init_post in bmon-conf.o
_get_lifecycles in bmon-conf.o
_configfile_read_history in bmon-conf.o
"_cfg_getint", referenced from:
_conf_init_post in bmon-conf.o
_configfile_read_history in bmon-conf.o
_configfile_read_element_cfg in bmon-conf.o
_main in bmon-bmon.o
"_cfg_getnfloat", referenced from:
_add_div in bmon-conf.o
"_cfg_getnsec", referenced from:
_configfile_read_units in bmon-conf.o
_configfile_read_history in bmon-conf.o
_configfile_read_attrs in bmon-conf.o
_configfile_read_element_cfg in bmon-conf.o
"_cfg_getnstr", referenced from:
_add_div in bmon-conf.o
"_cfg_getstr", referenced from:
_conf_init_post in bmon-conf.o
_configfile_read_history in bmon-conf.o
_configfile_read_attrs in bmon-conf.o
_configfile_read_element_cfg in bmon-conf.o
"_cfg_init", referenced from:
___conf_init in bmon-conf.o
"_cfg_parse", referenced from:
_conf_read in bmon-conf.o
"_cfg_parse_buf", referenced from:
_conf_init_pre in bmon-conf.o
"_cfg_setbool", referenced from:
_main in bmon-bmon.o
"_cfg_setfloat", referenced from:
_main in bmon-bmon.o
"_cfg_setint", referenced from:
_set_unit_exp in bmon-conf.o
_main in bmon-bmon.o
"_cfg_setstr", referenced from:
_main in bmon-bmon.o
"_cfg_size", referenced from:
_configfile_read_units in bmon-conf.o
_configfile_read_history in bmon-conf.o
_configfile_read_attrs in bmon-conf.o
_configfile_read_element_cfg in bmon-conf.o
_add_div in bmon-conf.o
"_cfg_title", referenced from:
_configfile_read_units in bmon-conf.o
_configfile_read_history in bmon-conf.o
_configfile_read_attrs in bmon-conf.o
_configfile_read_element_cfg in bmon-conf.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [bmon] Error 1
make: *** [all-recursive] Error 1

Detail of the first error:

/opt/src/bmon-3.6> search -cv “_cfg_free” .
./compiler-stderr.log:2: "_cfg_free", referenced from:
./compiler-stderr.log:4: (maybe you meant: _element_cfg_free)
./include/bmon/element_cfg.h:50:extern void element_cfg_free(struct element_cfg *);
./src/element_cfg.c:62:static void __element_cfg_free(struct element_cfg *ec)
./src/element_cfg.c:71:void element_cfg_free(struct element_cfg *ec)
./src/element_cfg.c:76: __element_cfg_free(ec);
./src/element_cfg.c:95: __element_cfg_free(ec);
/opt/src/bmon-3.6>

segfault

Sometimes I get segfault at startup (Arch Linux x64), with gdb I can see this:

[...]
#87243 0x000055555557508b in find_qdiscs (rdata=0x7fffffffcf40, parent=3, ifindex=<optimized out>)
    at in_netlink.c:627
#87244 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#87245 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87246 0x0000555555574238 in find_classes (parent=0, rdata=0x7fffffffd070) at in_netlink.c:654
#87247 0x00005555555743ec in handle_qdisc (obj=0x611000001940, arg=<optimized out>) at in_netlink.c:682
#87248 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87249 0x000055555557508b in find_qdiscs (rdata=0x7fffffffd180, parent=3, ifindex=<optimized out>)
    at in_netlink.c:627
#87250 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#87251 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
---Type <return> to continue, or q <return> to quit---
#87252 0x0000555555574238 in find_classes (parent=0, rdata=0x7fffffffd2b0) at in_netlink.c:654
#87253 0x00005555555743ec in handle_qdisc (obj=0x611000001940, arg=<optimized out>) at in_netlink.c:682
#87254 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87255 0x000055555557508b in find_qdiscs (rdata=0x7fffffffd3c0, parent=3, ifindex=<optimized out>)
    at in_netlink.c:627
#87256 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#87257 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87258 0x0000555555574238 in find_classes (parent=0, rdata=0x7fffffffd4f0) at in_netlink.c:654
#87259 0x00005555555743ec in handle_qdisc (obj=0x611000001bc0, arg=<optimized out>) at in_netlink.c:682
#87260 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87261 0x000055555557508b in find_qdiscs (rdata=0x7fffffffd600, parent=1, ifindex=<optimized out>)
    at in_netlink.c:627
#87262 handle_class (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:614
#87263 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87264 0x0000555555574238 in find_classes (parent=4294967295, rdata=0x7fffffffd730) at in_netlink.c:654
#87265 0x0000555555574440 in handle_qdisc (obj=obj@entry=0x6110000016c0, arg=arg@entry=0x7fffffffd830)
    at in_netlink.c:679
#87266 0x0000555555574cd2 in handle_tc (link=<optimized out>, e=0x617000000b00) at in_netlink.c:702
#87267 do_link (obj=<optimized out>, arg=<optimized out>) at in_netlink.c:824
#87268 0x00007ffff65955a9 in nl_cache_foreach_filter () from /usr/lib/libnl-3.so.200
#87269 0x0000555555572e7f in module_foreach_run_enabled (ss=0x555555793fc0 <input_subsys>)
    at module.c:55
#87270 0x00005555555681ff in main (argc=<optimized out>, argv=<optimized out>) at bmon.c:349

blank window if bmonrc exists

Linux Mint 17 Cinnamon
bmon 3.3

I downloaded bmon-master.zip from github.
I needed the following to build bmon 3.3:

sudo apt-get -y install build-essential
sudo apt-get -y install dh-autoreconf
sudo apt-get -y install libncurses5-dev
sudo apt-get -y install libconfuse-dev
sudo apt-get -y install libnl-dev
sudo apt-get -y install libnl-3-dev
sudo apt-get -y install libnl-route-3-dev

bmon 3.3 runs but still has the same problem:
If a .bmonrc exists there is only a blank terminal window and Ctrl-C will dismiss.

I have tried a blank .bmonrc created with 'touch .bmonrc' and also copying the /etc/bmon.conf to $HOME/.bmonrc, still only blank window.

So... instead I am using a shell file with the following:

uxterm -geometry 81x53+1-1 -title "bmon" \
  -bg azure -fg black \
  -e 'bmon -p !lo -o curses:details'

That works very well.

segfault

tried running bmod 3.9 on arch linux with 4.8.6-1-ARCH kernel

after couple of seconds bmon gets killed with "unauthorized access to memory (SIGSEGV)"

Remove "Really quit" nag

Perhaps my usage of bmon is non-typical and this would be an unpopular change. but:

My usage of bmon doesn't involve accumulating lots of user inputted state in the program; that is to say, if bmon were to close unexpectedly, then I can just start it back up and be where I was. When I'm done with bmon I hit q to leave, and am caught out by the "Really Quit" nag every time.

Compare to a similar program htop which has no such guard against accidental quitting.

Default colors : how to enable it?

Hello,
I saw in the code that there is a call to the curses function use_default_colors() which enable to use transparency of the terminal if it is set that way.
But I cannot figure out how to enable it in the configuration file.
Could you make a documentation about the configuration file?
Thanks.

Configure input option via bmon.conf

I would like to set the input to netlink:notc by default.

However, it seems like the input is not configurable in bmon.conf or bmonrc. Did I miss something? Is it something that would be feasible/desirable?

For reference, #74 had a similar issue.

Segfault error 6 in libc-2.27.so

Hi,

Saw a sefault in dmesg:

bmon[16429] segfault at 7ffe54c89ff8 ip 00007f2366d8e4b3 sp 00007ffe54c8a000 error 6 in libc-2.27.so[7f2366d00000+1e7000]

This is an AWS Ubuntu 18.04.4 LTS instance with kernel:
Linux ip-10-0-1-254 4.15.0-1065-aws #69-Ubuntu SMP Thu Mar 26 02:17:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

apt info:

Package: bmon
Version: 1:4.0-4build1
Priority: optional
Section: universe/net
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Patrick Matthäi [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 142 kB
Depends: libc6 (>= 2.8), libconfuse2 (>= 3.2.1~), libncurses5 (>= 6), libnl-3-200 (>= 3.2.7), libnl-route-3-200 (>= 3.2.7), libtinfo5 (>= 6)

If you need more info, please let me know

"detailed statistics" does not color its whole area

On my terminal emulator, I have set the default background color and black color to be different. The "detailed statistics" does not black out the entirety of its area, as seen in these pictures:
curses
curses3
curses2

It's pretty reproducible, no matter how many times you enable/disable d and i you still get that particular area of the screen not blacked out.

Feature: Unix Timestamp

A quick feature request. When output is ASCII, it would be nice if it would dump the unix timestamp (i.e. date/time) with each record. This way, it can be correlated with other source of data, such as a tcpdump.
A simple call to clock_gettime(CLOCK_REALTIME) should work, just dump the raw 64 bit number, no need to convert it to a date/time string (scripts are pretty good at that job, simple numbers are easier to parse). See tcpdump -tt for example.
Thanks in advance !

bmonrc policy order

In the .bmonrc I added:

policy='wlp3s0,enp2s0'

In the hope that the wireless interface would be the first in the list. But it seems the order is alphabetical.

Would it be possible to have the interface selector list by the order in policy ?

bmon issue with virtualbox

Hello,

I was wondering if anyone ever did try to use bmon with vboxnet0?
When I use iptraf-ng I see data between my host and guest.
bmon on the other end does not show anything.

I am on Ubuntu 20.04

$ uname -a
Linux workbox 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:37:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ apt show bmon
Package: bmon
Version: 1:4.0-6

Unreadable output due to fq_codel qdisc

When you use some traffic control/shaping mechanism and you add for instance fq_codel qdisc at the top of some class, the result in bmon is a little bit unreadable. Is there a way to remove those classes?

2016-05-13-20 29 30_selection

formatted output cannot be piped

bmon -o format > file.txt creates an empty file. It is not possible to pipe the output of the program to a file (because of curses, I presume); I ran into this when trying to read the output of bmon from a parent process.

bmon Segmentation fault

Core was generated by `bmon -b'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000000000040613b in element_check_if_dead ()

(gdb) bt
#0 0x000000000040613b in element_check_if_dead ()
#1 0x00000000004056ac in __group_foreach_element ()
#2 0x00000000004056c4 in __group_foreach_element ()
#3 0x00000000004056c4 in __group_foreach_element ()
#4 0x0000000000405720 in group_foreach_recursive ()
#5 0x0000000000403c23 in main ()

(gdb) Quit
(gdb) Quit
(gdb) bt
#0 0x000000000040613b in element_check_if_dead ()
#1 0x00000000004056ac in __group_foreach_element ()
#2 0x00000000004056c4 in __group_foreach_element ()
#3 0x00000000004056c4 in __group_foreach_element ()
#4 0x0000000000405720 in group_foreach_recursive ()
#5 0x0000000000403c23 in main ()

(gdb) info reg
rax 0x1 1
rbx 0xd203c0 13763520
rcx 0x7fd756317501 140562840777985
rdx 0x7fd7565c2c30 140562843577392
rsi 0xd04000 13647872
rdi 0x0 0
rbp 0xbf77e0 0xbf77e0
rsp 0x7ffd85d6b3d0 0x7ffd85d6b3d0
r8 0x7fd757586700 140562860107520
r9 0xd1f720 13760288
r10 0xffffffffffffff07 -249
r11 0x206 518
r12 0xbf7810 12548112
r13 0xbd7a70 12417648
r14 0x40612a 4219178
r15 0x0 0
rip 0x40613b 0x40613b <element_check_if_dead+17>
eflags 0x10202 [ IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
(gdb) info locals
No symbol table info available.
(gdb) up
#1 0x00000000004056ac in __group_foreach_element ()

(gdb) info locals
No symbol table info available.
(gdb) info reg
rax 0x1 1
rbx 0xd203c0 13763520
rcx 0x7fd756317501 140562840777985
rdx 0x7fd7565c2c30 140562843577392
rsi 0xd04000 13647872
rdi 0x0 0
rbp 0xbf77e0 0xbf77e0
rsp 0x7ffd85d6b3e0 0x7ffd85d6b3e0
r8 0x7fd757586700 140562860107520
r9 0xd1f720 13760288
r10 0xffffffffffffff07 -249
r11 0x206 518
r12 0xbf7810 12548112
r13 0xbd7a70 12417648
r14 0x40612a 4219178
r15 0x0 0
rip 0x4056ac 0x4056ac <__group_foreach_element+59>
eflags 0x10202 [ IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0

I had enabled bmon debug mode .
Then output : element.c:326 element_check_if_dead: Deleting dead element

How to enable transparent background?

I try to add this to .bmonrc

layout colors {
    color default {
       color_pair  = {"white", "default"}
    }
    color statusbar {
        color_pair = {"blue", "default", "reverse"}
    }
    color header {
        color_pair = {"yellow", "default"}
    }
    color list {
        color_pair = {"white", "default"}
    }
    color selected {
        color_pair = {"white", "default", "reverse"}
    }
    color RX_graph {
        color_pair = {"green", "default"}
    }
    color TX_graph {
        color_pair = {"red", "default"}
    }
}

but i got this error when run bmon:

Unknown color [bg]: default

When I run bmon -ocurses:nocolors I got the transparent background but other text color is white.

If I modify layout.h here: https://github.com/tgraf/bmon/blob/master/include/bmon/layout.h#L126 to make bg_code = -1, I get the transparent. Not sure why there is a check to prevent bg_code = -1 at line 97.

3.9: FTBFS on kFreeBSD (‘struct if_data’ has no member)

As reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826836
bmon 3.9 FTBFS on kFreeBSD:

in_sysctl.c: In function ‘sysctl_read’:
in_sysctl.c:236:59: error: ‘struct if_data’ has no member named ‘ifi_recvquota’
   snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_recvquota);
                                                           ^
in_sysctl.c:239:59: error: ‘struct if_data’ has no member named ‘ifi_xmitquota’
   snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_xmitquota);
                                                           ^

Proposed patch is the following (though I'm not sure if it is the best way to fix the problem):

--- a/src/in_sysctl.c
+++ b/src/in_sysctl.c
@@ -231,9 +231,9 @@

                snprintf(info_buf, sizeof(info_buf), "%ju", (uintmax_t)ifm->ifm_data.ifi_metric);
                element_update_info(e, "Metric", info_buf);

-#ifndef __NetBSD__
+#ifdef __APPLE__
                snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_recvquota);
                element_update_info(e, "RX-Quota", info_buf);

                snprintf(info_buf, sizeof(info_buf), "%u", ifm->ifm_data.ifi_xmitquota);

FYI detecting kFreeBSD can be done using __FreeBSD_kernel__:
https://wiki.debian.org/Debian_GNU/kFreeBSD_FAQ#Q._How_do_I_detect_kfreebsd_with_preprocessor_directives_in_a_C_program.3F

Average Bandwidth Usage

Hey,

I am wondering if the way to calculate the average bandwidth usage of a scanning tool like Nmap, is to measure the total number of RX and TX bytes and divide them by scan time.

Unwrap simple tunnels

I use a 6in4 tunnel for my IPv6 support. Unfortunately, bmon just shows the entire IPv6 path as a single "connection". It would be nice if there was a way to get it to look at the wrapped IPv6 header and show the real IPv6 connections individually.

model to set bmonrc

hello,
i'm trying to set my .bmonrc like that:
policy = "wlp* eth*" input = netlink:notc output = curse:graph,ngraph=1,gwidth=50,'details;info'
to get the following command line result:bmon -p 'wlp*,eth*' -inetlink:notc -ocurses:{graph,ngraph=1,gwidth=50,'details;info'}

but i can't. what's wrong?

Inappropriate program name

Sorry to inform you, but what your program displays, is called data rate – and not bandwidth by any means. Bandwidth has the unit Hz (Hertz) and specifies a frequency range. It doesn’t even correlate, because a higher data rate doesn’t necessarily depend on a higher bandwidth, as there are quite a number of factors which influence transmission speed and quality. So even as the bandwidth increases, depending on the circumstances, the data rate could even decline.

I know that this is a common misunderstanding and even self-declared “experts” write about bandwidth while actually they’re writing about data rates – but that still remains wrong.

Curses Output: gwidth option is broken

# ./bmon -v
bmon 4.0

how to reproduce:

  1. run bmon
    ./bmon -o curses:graph -o curses:details -ocurses:ngraph=8 -ocurses:gwidth=120 -p eth0

  2. press a button to start a record
    It goes back to 60n (default value)

broken

Toggle quick reference

Linux Mint 17 Cinnamon
bmon 3.3

Pressing ? for help displays the QUICK REFERENCE, as expected.
Listed in help:
? Toggle quick reference

But '?' does NOT toggle, that is, help remains displayed.
I can dismiss help only with 'esc'.

Is this only a documentation error?

Errors in bmon.conf example

bmon 4.0 from Debian
If you uncomment the section "element eth0" (obviously adapting the interface name), you'll get this error:
###########
/etc/bmon.conf:14: unexpected token '{'
Error while reading configfile "/etc/bmon.conf": parse error
###########
Removing the curly braces enclosing the value of "description", "rxmax", "txmax" and "max" resolve the problem.

However i still have to understand the meaning of "rxmax", "txmax" and "max": i guessed they was meant to set a fixed graph scale, disabling the automatic scale change. But the only change i can see setting these values is the creation of the RxMax/TxMax field in the information pane.
Please, can you clarify it, at least with a comment in the bmon.conf file?

bmon does not exit after the user chooses to quit (deadlock?)

On a LEDE system, bmon 3.9 does not exit after the user chooses to quit. The curses display closes as expected, but then bmon does not give back a shell prompt, and just sits there doing nothing (without consuming any CPU cycles). It does not react to Ctrl-c or normal kill signals. Only a kill -9 allows the program to exit.

This looks like a deadlock during cleanup/shutdown. I do not remember this issue occurring with bmon 3.8, but I can test again (maybe it's something that changed in LEDE).

This is using LEDE r1670, with musl 1.1.15 and linux 4.4.21.

3.3: blank screen

I just built Bmon-3.3 on Debian x86_64 but when started it show only blank (black) screen. This is regression from v3.2.

out_ascii.c: 2 * possible reads of bad data ?

out_ascii.c:62:6: warning: variable 'tx1prec' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
out_ascii.c:67:6: warning: variable 'tx2prec' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Suggest initialise local variable tx1prec and tx2prec at their declarations.

3.7.x series in Fedora current and future?

Just switched over to Fedora 25 from Ubuntu 16.10 and noticed that the version of bmon in current and future Fedora is 3.7.x series. Was hoping to get back to >= 3.9.x in order to pull in color support.

Is 3.7 considered the more stable release and thus the inclusion in Fedora? Some reason why I might not consider rolling a custom Fedora RPM for >= 3.9.x?

Thx for the very nifty tool, btw. Very useful.

Formatted output always reports 0 for initial tx/rx rate

Issue Type:
Bug report

What happened:
Using formatted output along with quitafter always incorrectly returns 0 traffic for the first output reported, regardless of the sampling interval or the number of outputs specified via quitafter.

Steps to reproduce:
Monitor an interface with active connections, for example 'eth*'.
Issue the command:

bmon -p eth* -o format:'fmt=$(element:name)\t$(attr:rxrate:bytes)\t$(attr:txrate:bytes)\n;quitafter=5'

If the rate interval is adjust downward, this behavior tends to appear on more of the outputs. For example, at a rate of 0.05, the first 3 outputs show 0 traffic on all interfaces.

What was the expected behavior:
The library should report only traffic it has actually observed. The fact that this behavior occurs on more than the first output as the rate interval is reduced suggests that this bug is related to not having enough time to make a traffic observation. Reporting 0 traffic because there has not been enough time to make an observation is misleading, and arguably worse than not reporting at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.