If the element currently selected is removed due to inactivity, the
selection is fixed up to the previous element in the list. This step
must be done after the entire element subgroup has been removed.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
So far, any output module with a selection capability defaulted to
the first interface in the list as first pick. This uses the policy
configuration instead and thus allows to select which interface to
display first:
Examples:
bmon -p 'em1,*'
bmon -p 'eth*,lo,*'
The first rule that finds a matching interface is used and will
trigger initial selection.
Note that this is *ONLY* evaluated after the first read of the
statistics so if a more preferred interface appears later, the
selection will not be changed.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit enables colors in bmon. It adds configuration options to
let the user decide, which colors should be used. Therefor the graph_rx and graph_tx
layouts are introduced and applied respectively.
* Add graph_rx, graph_tx and layout_cfg fields.
* Setting default colors if colorized output is enabled.
* draw_table accept additional layout parameter and apply the given layout for
the table graph.
* Apply layouts for rx, tx graph and header and statusbar.
* Add include/layout.h, which provides functions to parse, color and attribute
strings and set the layout.
* Adding a default layout-config example in examples/bmon.conf.
[Edit: Based on original work by eri!, #PR23]
When compiling bmon with gcc 6.1 it complains with the following
warning:
out_format.c: In function ‘get_token’:
out_format.c:134:10: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
} else if (!strncasecmp(token+5, "txrate:", 7))
^~
out_format.c:136:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
return buf;
^~~~~~
Indeed, the 'return buf' should only be executed if it was snprintf()'ed
to. Otherwise "unknown" should be returned. Fix this by adding braces.
Also use the 'type' variable in strncasecmp() as in the other checks.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Press 'r' in curses mode to reset a statistic counter to
start counting from 0 again. This does NOT reset the
counter from the source itself but merely emulates a
counter reset. If you restart bmon, the counter will be
back to its total value.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
The qdisc cache is host wide, the parent classid is not unique
so the ifindex of the parent tc object must be set in the filter
otherwise a leaf qdisc with an identical parent id in another
device can be mistaken.
This also converts the class_cache to be passed up through the
stack to make clear it is not system wide but specific to the
ifindex we are currently handling.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Fixes sparse warnings:
attr.c:114:6: warning: symbol 'attr_def_free' was not declared. Should it be static?
element.c:116:16: warning: symbol '__lookup_element' was not declared. Should it be static?
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Fixes sparse warnings:
bmon.c:36:5: warning: symbol 'do_quit' was not declared. Should it be static?
bmon.c:37:5: warning: symbol 'is_daemon' was not declared. Should it be static?
bmon.c:91:12: warning: symbol 'sig_int' was not declared. Should it be static?
bmon.c:98:6: warning: symbol 'sig_exit' was not declared. Should it be static?
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Hook up additional IPv6 link statistics counters available since libnl
v3.2.25. Also add compatibility defines, so bmon can still be compiled
against older libnl versions.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Up to now, the entire Netlink module was disable if QoS statistics were
not available. Merely disable TC stats themselves but continue using
the input module.
Reported-by: Wen Chiu <Wen.Chiu@brocade.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>