Big Brother (or bb) is a tool for monitoring the availability of network devices, servers and much more. The default tool has a basic set of tests for checking connectivity, and a variety of services like web pages, ssh, telnet, ftp, and dns. In addition to the standard tests, many extensions have been written, and Big Brother has grown to become a central reporting tool for a wide variety of tests on all sorts of platforms. A large archive of the extensions and other tests for Big Brother can be found at www.deadcat.net.
Hobbit is a replacement for Big Brother that started out as the bbgen toolkit. It was written to support small and large networks. It offers enhancements such as integrated graphing of some tests and parallel ping tests (using fping) for performance. Hobbit is released under the GPL.
MRTG started as a tool for monitoring traffic on network links. Like Big Brother, it has been extended by the user community to monitor all sorts of other data beyond network traffic. I've used it for montioring memory and disk usage on Netware servers, traffic on network switches and servers, and Squid (a web proxy) traffic. Others have used the tool to monitor much more.
This document deals primarily with the use of BBMRTG, a Big Brother extension that integrates the results of MRTG data collection and graphing into a Hobbit or Big Brother display as shown on the right. The integration is twofold:
The latest version of BBMRTG (bbmrtg-v1.8) should be available from deadcat.net. Note that it's been forked once already, although Chris Cook has managed to merge the forked changes back into v1.5, which is were I started from when adding features to create v1.6.
As already mentioned, BBMRTG is an extension, meaning installation of the script is a simple as copying bbmrtg.pl to your ext directory on the Hobbit/bb server, and on *NIX machines making it executable.
Big Brother itself needs only a couple of changes to get bbmrtg working:
: : bbmrtg.pl").Hobbit needs only to have bbmrtg added to $HOBBITHOME/etc/hobbitlaunch.cfg as follows:
[bbmrtg]
ENVFILE /opt/hobbit/server/etc/hobbitserver.cfg
CMD /opt/hobbit/server/ext/bbmrtg.pl
LOGFILE $BBSERVERLOGS/bbmrtg.log
INTERVAL 5m
Configuration of BBMRTG is done in two locations: the script itself, and the MRTG configuration files. Global parameters are are defined at the top of the script, and are well documented there. Pay special attention to the locations of your libraries and configurations (the first two options), as the precise paths are needed in order for the script to work at all.
BBMRTG reads a standard MRTG configuration file and looks for specific additional parameters identified with a bb*
prefix. These parameters tell BBMRTG how to label columns, what the threshold values are for each status colour are, and how to
label the graphical output.
Later versions of MRTG's cfgmaker utility supports the use of templates that simplify the creation of bbmrtg.pl ready configuration files. The following example can be used to create such a config file in one step. Paste the template into a file and call it with the cfgmaker command-line shown below.
#
# Template for use with bbmrtg.pl script (integrates MRTG output into Hobbit/BigBrother)
# 2004-11-17 - Al Payne (apayne at pleiades.com)
# define how many interfaces are grouped into a column in Big Brother:
my $bbgroup=8;
# name the column in BB
my $bbintgrp=int($ifindex/$bbgroup);
my $bbsvc=sprintf("int%02d-%02d",
int($ifindex/$bbgroup)*$bbgroup+1,
(int($ifindex/$bbgroup)+1)*$bbgroup
);
$target_lines .= <<ECHO;
$default_target_directive
# bb* = Big Brother info
bb*host[$target_name]: $$router_ref{routername}
bb*svc[$target_name]: $bbsvc
bb*unit[$target_name]: bytes/sec
ECHO
if ($if_snmp_alias) {
$target_lines .= <<ECHO;
bb*althost[$target_name]: $if_snmp_alias
bb*altsvc[$target_name]: traffic
ECHO
}
#$default_setenv_directive
my $setEnvLine = ($if_snmp_alias) ?
"SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"Interface to $if_snmp_alias\"" :
"SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"$if_snmp_descr\"";
$target_lines .= <<ECHO;
$setEnvLine
$default_directory_directive
$default_maxbytes_directive
$default_title_directive
$default_pagetop_directive
ECHO
For additional examples of templates, see the Somix Technologies MRTG repository for a great collection.
After creating the above template, run cfgmaker as follows:
cfgmaker --if-template=<template_name> host -output host.cfg
If all goes well, you should end up with an MRTG config file that includes the information BBMRTG needs on each interface, as shown in the example below.
### Interface 1 >> Descr: 'EtherNet-Port-on-unit-1,-port:1' # | Name: 'Port1' | Ip: '192.168.0.13' | Eth: '00-0f-1f-33-52-19' ### Target[it-0560_1]: 1:community@it-0560: # bb* = Big Brother info bb*host[it-0560_1]: it-0560 bb*svc[it-0560_1]: int01-08 bb*unit[it-0560_1]: bytes/sec bb*althost[it-0560_1]: 2k-citrix bb*altsvc[it-0560_1]: traffic SetEnv[it-0560_1]: MRTG_INT_IP="192.168.0.13" MRTG_INT_DESCR="Interface to 2k-citrix" MaxBytes[it-0560_1]: 125000000 Title[it-0560_1]: Traffic Analysis for 1 -- it-0560 PageTop[it-0560_1]: <H1>Traffic Analysis for 1 -- it-0560</H1>
The resulting host.cfg file is the file you'll want to point bbmrtg.pl at. Edit the script and set $mrtgCfg to point to it. Alternatively, if you have several config files, list them as includes in a seperate configuration file and point $mrtgCfg to it.
BBMRTG is now configured and ready to report MRTG results to Hobbit/Big Brother. Note that BBMRTG does not actually collect the data - you'll still need to configure MRTG to run and do the actual data collection.
If you use mrtg-rrd to generate your graphs when needed, you'll need to patch the script so that it recognizes the bb* parameters as legitimate.
Questions and comments are welcome via email to apayne@pleiades.com. Be sure to include the name of the script in the subject of your message in order to avoid the spam trap.
Changes:
15 Dec 2004 - links to new scripts, graphic added
13 Jan 2005 - added bb config notes from Jim Johnson
19 Feb 2005 - update bbmrtg link to reflect latest version
12 Mar 2005 - updated page to include information about Hobbit
10 May 2005 - added Somix Technologies link
04 Nov 2005 - update bbmrtg link to v1.8
Copyright © 2004-2006 - Al Payne