Hobbit Tips and Tricks

Here you will find out how to do some common questions raised with Hobbit.


What do the little red/yellow/green icons mean ?

ColorRecently changedLast change > 24 hours
Green: Status is OKGreen - recently changedGreen
Yellow: WarningYellow - recently changedYellow
Red: CriticalRed - recently changedRed
Clear: No dataClear - recently changedClear
Purple: No reportPurple - recently changedPurple
Blue: DisabledBlue - recently changedBlue

My client-side tests dont show up on the webpages

Did you install a client ? The Hobbit client package is installed automatically only on the Hobbit server - on other systems, you must build the client package by running Hobbit's configure-script with the "--client" option and build the client package on the hosts you want to monitor.

If you did install a client, then the two most probable causes for this are:


My silly clients are using a hostname different from the one in bb-hosts

Add a CLIENT:clienthostname tag to the host entry in the bb-hosts file, or re-configure the client to use the proper hostname.


Where are the bbrm and bbmv commands from Big Brother ?

They have been integrated into the Hobbit network daemon. See the next three questions.


I accidentally added an 'ftp' check. Now I cannot get it off the webpage!

Use the command

    ~/server/bin/bb 127.0.0.1 "drop HOSTNAME ftp"

to permanenly remove all traces of a test. Note that you need the quotes around the "drop HOSTNAME ftp".


So how do I get rid of an entire host in Hobbit?

First, remove the host from the ~/server/etc/bb-hosts file. Then use the command

    ~/server/bin/bb 127.0.0.1 "drop HOSTNAME"

to permanenly remove all traces of a host. Note that you need the quotes around the "drop HOSTNAME".


How do I rename a host in the Hobbit display?

First, change the ~/server/etc/bb-hosts file so it has the new name. Then to move your historical data over to the new name, run

    ~/server/bin/bb 127.0.0.1 "rename OLDHOSTNAME NEWHOSTNAME"

Getting the Apache performance graphs

Charles Jones provided this recipe on the Hobbit mailing list:


From: Charles Jones
Date: Sun, 06 Feb 2005 21:28:19 -0700
Subject: Re: [hobbit] Apache tag

Okay, first you must make the indicated addition to your apache
httpd.conf (or you can make a hobbit.conf in apaches conf.d directory).
[ed: See the bb-hosts man-page for the "apache" description]

Then, you must restart apache for the change to take effect
(/etc/init.d/httpd restart).

Then, manually test the server-stats url to make sure it's working, by
using your browser and going to
http://your.server.com/server-status?auto  (you can also go to
http://your.server.com/server-status/ to get some nice extended apache
performance info).  You should get back something like this:

Total Accesses: 131577
Total kBytes: 796036
CPULoad: 1.0401
Uptime: 21595
ReqPerSec: 6.09294
BytesPerSec: 37746.7
BytesPerReq: 6195.16
BusyWorkers: 43
IdleWorkers: 13

Scoreboard: RR__RWR___RR_R_RR_RRRRRRRRR_RRRRRRR__RRR_RRRRCRRRRR_RRRR........................................................................................................................................................................................................

Now, assuming you are getting back the server-status info, time to make
sure your bb-hosts is correctly configured to collect and graph the
data.  Heres what I have in mine:

1.2.3.4    my.server.com  # conn ssh http://1.2.3.4 apache=http://1.2.3.4/server-status?auto TRENDS:*,apache:apache|apache1|apache2|apache3

 From what you said of your setup, I'm guessing your only problem is
 using the wrong url for the apache tag (you used
 "apache=http://192.168.1.25/hobbit/" which just won't work - that's the
 kind of URL you would use for the http tag).

 Hope this helped.

 -Charles

How can I add MRTG graphs to the Hobbit webpages?

There is a special document for this, describing how you can configure MRTG to save data in a format that Hobbit can handle natively.


I need the web-pages to update more frequently

The ~/server/etc/hobbitlaunch.cfg defines the update interval for all of the Hobbit programs. The default is for network tests to run every 5 minutes, and webpage updates to happen once a minute.

Note that if you run the bbretest-net.sh tool on your network test server (this is the default for a new Hobbit server), then network tests that fail will run every minute for up to 30 minutes after the initial failure, so usually there is little need to change the update interval for your network tests.


I want my temperature graphs in Fahrenheit

Edit the file server/etc/hobbitgraph.cfg, and change the [temperature] definition from the default one to the one below that shows Fahrenheit graphs.


How do I remove the HTML links from the alert messages?

Configure your alerts in server/etc/hobbit-alerts.cfg to use FORMAT=PLAIN instead of TEXT.


I cannot see the man-pages on the web

A common Apache configuration mistakenly believes any filename containing ".cgi" is a CGI-script, so it refuses to present the man-pages for the CGI scripts. Stephen Beaudry found the solution:

   This occurs because by default, apache associates the cgi-script
   handler with any filename containing ".cgi".  I fixed this on my server
   by changing the following line in my httpd.conf

   AddHandler cgi-script .cgi     ->to->    AddHandler cgi-script .cgi$

My alert emails come without a subject

Hobbit by default uses the system mail command to send out messages. The mail-command in Solaris and HP-UX does not understand the "-s SUBJECT" syntax that Hobbit uses. So you get mails with no subject. The solution is to change the MAIL setting in etc/hobbitserver.cfg to use the mailx command instead. Hobbit needs to be restarted after this change.


Does Hobbit support receiving SNMP traps?

Not directly, but there is other Open Source software available that can handle SNMP traps. A very elegant method of feeding traps into Hobbit has been described in this article by Andy Farrior.


How can I create a custom test script?

Anything that can be automated via a script or a custom program can be added into Hobbit. A lot of extension scripts are available for Big Brother at the www.deadcat.net archive, and these will typically work without modifications if you run them in Hobbit. Sometimes a few minor tweaks are needed - the Hobbit mailing list can help you if you dont know how to go about that.

But if you have something unique you need to test, writing an extension script is pretty simple. You need to figure out some things:

A simple client-side extension script looks like this:


   #!/bin/sh

   COLUMN=mytest	# Name of the column
   COLOR=green		# By default, everything is OK
   MSG="Bad stuff status"

   # Do whatever you need to test for something
   # As an example, go red if /tmp/badstuff exists.
   if test -f /tmp/badstuff
   then
      COLOR=red
      MSG="${MSG}
 
      `cat /tmp/badstuff`
      "
   else
      MSG="${MSG}

      All is OK
      "
   fi

   # Tell Hobbit about it
   $BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`

   ${MSG}
   "

   exit 0

You will notice that some environment variables are pre-defined: BB, BBDISP, MACHINE are all provided by Hobbit when you run your script via hobbitlaunch. Also note how the MSG variable is used to build the status message - it starts out with just the "Bad stuff status", then you add data to the message when we decided what the status is.

To run this, save your script in the ~hobbit/client/ext/ directory (i.e. in the ext/ directory off where you installed the Hobbit client), then add a new section to the ~hobbit/client/etc/clientlaunch.cfg file like this:


   [myscript]
	ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
	CMD $HOBBITCLIENTHOME/ext/myscript.sh
	LOGFILE $HOBBITCLIENTHOME/logs/myscript.log
	INTERVAL 5m


Server-side scripts look almost the same, but they will typically use the bbhostgrep utility to pick out hosts in the bb-hosts file that have a special tag defined, and then send one status message for each of those hosts. Like this:


   #!/bin/sh

   BBHTAG=foo           # What we put in bb-hosts to trigger this test
   COLUMN=$BBHTAG	# Name of the column, often same as tag in bb-hosts

   $BBHOME/bin/bbhostgrep $BBHTAG | while read L
   do
      set $L	# To get one line of output from bbhostgrep

      HOSTIP="$1"
      MACHINEDOTS="$2"
      MACHINE=`echo $2 | $SED -e's/\./,/g'`

      COLOR=green
      MSG="$BBHTAG status for host $MACHINEDOTS"

      #... do the test, perhaps modify COLOR and MSG

      $BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`

      ${MSG}
      "
    done

    exit 0

Note that for server side tests, you need to loop over the list of hosts found in the bb-hosts file, and send one status message for each host. Other than that, it is just like the client-side tests.