There is a nice write-up about incorporating custom scripts into hobbit (xymon) on the help menu @ help->.Tips and Tricks.
The status "dot" will appear by whatever you tell hobbit to place it at in your "bb" status message. So the command that Josh put in point #2:
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
Actually expands to something like:
/hobbit/client/bin/bb 10.1.1.25 "status myserver.dns.domain Custom_Test green Wed Nov 4 08:19:23 CST 2009"
So on your web page a server named myserver.dns.domain with a test column of Custom_Test with a green status.
........Bruce
Bruce White Senior Enterprise Systems Engineer | Phone: 630-671-5169 | Fax: 630-893-1648 | bewhite at fellowes.com | http://www.fellowes.com/
Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Fellowes, Inc.
From: Josh Luthman [mailto:josh at imaginenetworksllc.com] Sent: Monday, November 02, 2009 5:54 PM To: hobbit at hswn.dk Subject: Re: [hobbit] custom scripts
- Look at http://xymon.com/hobbit-cgi/viewconf.sh 172.16.10.5 miro.hswn.dk # ssh http://miro.hswn.dk/
Then look at the miro.hswn.dk server under the http column here: http://xymon.com/hobbit/servers/servers.html
Just put your information in. No custom script needed.
- I can't help with custom scripts but the document expressed you need to...
Tell Hobbit about it
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR date
and you have not done that in your script - that's definitely a concern. Perhaps looking at other scripts will help you - these are on the Deadcat and Xymonton here: http://www.deadcat.net/ http://xymonton.trantor.org/doku.php
Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373
"When you have eliminated the impossible, that which remains, however improbable, must be the truth." --- Sir Arthur Conan Doyle
On Mon, Nov 2, 2009 at 3:40 PM, Payam Jahromi <pjahromi at checkpoint.com> wrote:
I am a newbie to Hobbit, and this is probably a simple question
to answer. Here is what I'm trying to do:
I have custom scripts I need to incorporate to Hobbit. I saw the
page http://hobbitmon.sourceforge.net/docs/hobbit-tips.html#scripts but I still don't completely understand it. If I could get 1 of my scripts set up, then I can probably figure out how to do the rest.
I have 2 types of custom scripts: client and server. Here is an
example of each. I just need to know exactly how the script would be set up. Note, I had these running on Nagios before:
1. (server) this is the custom script we ran on our old
monitoring (nagios):
#!/bin/sh
WEB_CHECK=`curl http://www.example.com | grep value | wc -l`
if [ $WEB_CHECK -eq 1 ]
then
echo "Result OK"
else
echo "Failed"
exit 2
fi
Question: Need to know how to incorporate this on the hobbit
server, and where it would show on the GUI?
2. (client) this is custom script that used "NRPE" on nagios:
- I have a script that runs on 3 clients, let's call it
/usr/local/sbin/script.pl
- this script returns an output of a number
- on the hobbit server, I want to be get the result of this
script for each client, add them together, then alert based on the number. So here is the script I had on the Nagios server:
#!/bin/sh
# Script to check transactions on ecom-1/2
THRESHOLD=1
SERVER1=`ssh server1 /usr/local/nrpe/script.pl`
SERVER2=`ssh server2 /usr/local/nrpe/script.pl`
SERVER3=`ssh server3 /usr/local/nrpe/script.pl`
TOTAL=`expr $SERVER1 + $SERVER2 + $SERVER3`
if [ $TOTAL -lt $THRESHOLD ] ; then
echo "Number ($TOTAL) Failed"
exit 2
else
echo "Number ($TOTAL) Success"
exit 0
fi
Question: How would I incorporate that in Hobbit?
Thanks!
Payam