CBAN bandwidth monitoring
CBAN is a bandwidth/traffic monitoring small application written in C. It displays the current traffic on the selected interface.This can be shown in bits or bytes. To install just type make in the src directory. After that you can do a make install to strip debug information and to move binary to ../bin directory.
Usage:
-h : print available options.
-m : output in a suitable form for MRTG (read below).
-r : output for rrd tool (read below).
-d : debug level 0 - none 1 - verbose 2 - near everything.
-i : select interface to monitor.
-u : specifies (in seconds) the delay between updates.
-b : print statistics in bits rather then in bytes.
-k : print statistics in kilo.
Using CBAN with MRTG:
In etc directory from the package you will find a file named sample-mrtg.cfg.
You can integrate (or refer) this file with your mrtg.cfg.
[sample-mrtg.cfg]
###########################
# eth0
Title[eth0]: Traffic eth0
MaxBytes[eth0]: 125000
AbsMax[eth0]: 125000
Options[eth0]: gauge
Target[eth0]: `/usr/sbin/cban -i eth0 -m`
PageTop[eth0]: eth0 statistics
YLegend[eth0]: Bytes/s
ShortLegend[eth0]: B/s
Legend1[eth0]: Incoming Traffic
Legend2[eth0]: Outgoing Traffic
Legend3[eth0]: Maximum Incoming Traffic
Legend4[eth0]: Maximum Outgoing Traffic
LegendI[eth0]: In:
LegendO[eth0]: Out:
WithPeak[eth0]: ymwd
############################
Using CBAN with RRDTOOL:
First you have to create the rrd database - a sample script is in ./etc/rrdtool/. This database should contain 2 data sources incoming and outgoing. After you created this database issue:
./cban -i eth0 -u 5 -r stats-eth0.rrd | rrdtool -
this will update your database with new records.
Everything that you need (except for rrdtool binary) for rrdtool is in etc/rrdtool directory from the package.
#!/bin/bash
./rrdtool create stats-eth0.rrd --step 300 \
DS:incoming:DERIVE:600:0:U \
DS:outgoing:DERIVE:600:0:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:12:168 \
RRA:AVERAGE:0.5:288:30 \
RRA:AVERAGE:0.5:288:365 \
RRA:MAX:0.5:12:168 \
RRA:MAX:0.5:288:30 \
RRA:MAX:0.5:288:365 \
Screenshots:
Changelog:
19-12-2001
-changed Makefile to work with non Intel CPU's
5-11-2001 - version 0.1.8
-added more samples in rrdtool directory
-changed the datebase creation
3-11-2001 - version 0.1.7
-changed rrdtool output values now it writes total bytes
4-10-2001 - version 0.1.6
-added rrd tool support
(-r switch);
- documentation
4-10-2001 - version 0.1.42
- added some escape codes to fix up(vt100) and clear screen
2-10-2001 - version 0.1.4
-added MRTG support ( -m switch)
-added a sample mrtg config file (in etc dir)
1-10-2001 - version 0.1.3
-added escape code to put the cursor on the first line
-changed from atol to strtoul - bug when numbers wore bigger then long.
- fixed conversion from proc
30-09-2001 - version 0.1.0
- first version.
Downloads:
You can browse source online here
Source Archive
0.1.8-0 source archive: cban-0.1.8-0.tgz
Older Versions
0.1.6-0 source archive: cban-0.1.6-0.tgz
0.1.4-2 source archive: cban-0.1.4-2.tgz
0.1.4 source archive: cban-0.1.4.tgz