[hobbit] Status Question
Henrik Stoerner
henrik at hswn.dk
Sat Feb 10 19:29:41 CET 2007
On Sat, Feb 10, 2007 at 09:21:34AM -0800, Michael Dingeldey wrote:
> Is there any way to query hobbit directly via an external script (separate from hobbit) so that
> I can get the current status of a device and display the status dot on a floor plan (or in this
> case, a hand-crafted web page with our floor plans as jpegs)?
Before re-inventing the wheel, you may want to check out the BBMap
utility available on the Big Brother add-ons site, http://deadcat.net/ .
I believe it can do this for you. Even though it's on the Big Brother
site, it should be compatible with Hobbit (it was originally written for
the bbgen toolkit, which over time evolved into Hobbit).
> What would I query? The reason I ask is that there is other information that I might want to monitor
> besides the connectivity status of the device.
There are several commands you can send to the Hobbit daemon to retrieve
the current value of one or more statuses.
bb 127.0.0.1 "hobbitdboard"
retrieves the list of all statuses. You can add a filter and a set of
fields you want to retrieve, e.g. to get the hostnames of all "http" tests that
are red you can do
bb 127.0.0.1 "hobbitdboard test=http color=red fields=hostname"
Another command is
bb 127.0.0.1 "hobbitdlog host=HOSTNAME test=TESTNAME"
retrieves the full status message of a single test.
If convenient, there are also "hobbitdxboard" and "hobbitdxlog" commands
that return this in an XML format.
Finally, there's a "query" command:
bb 127.0.0.1 "query HOSTNAME.TESTNAME"
This returns the first line of the status, with the color as the first
word.
Regards,
Henrik
More information about the Xymon
mailing list