I was just thinking that xymondboard might be a good starting point for an API. I just put a very simple CGI script on my server:
#!/bin/bash
echo "Content-Type: text/plain"
echo ""
/home/xymon/server/bin/xymon localhost "xymondboard $QUERY_STRING"
then called it using curl:
curl -s -S -L "http://server.domain.com/xymon-cgi/xap.sh?color=red"
curl -s -S -L "http://server.domain.com/xymon-cgi/xap.sh?color=yellow"
curl -s -S -L "http://server.domain.com/xymon-cgi/xap.sh?color=purple"
Piping those through "wc" I get a total of 3305 bytes for all three. Fetching the non-green page:
curl -s -S -L "http://server.domain.com/xymon/nongreen.html"
gives me 30070 bytes. Obviously that's going to depend on reporting activity - I currently only have 14 lines in the "events received in the past 240 minutes" block.
Ralph Mitchell
On Thu, Nov 3, 2011 at 7:55 AM, <henrik at hswn.dk> wrote:
On Thu, 3 Nov 2011 07:01:32 -0400, Ralph Mitchell <ralphmitchell at gmail.com> wrote:
Henrik, has the format of hobbitdboard / xymondboard changed much between versions?? It would be fairly easy to make that available via a cgi script and it would be easier to parse than html.
No, this format is fairly static - and you can make it entirely "fixed" by adding a "fields" option to select the data-items you are interested in.
But to pick only the hosts that appear on a specific page must be done on the Xymon server - you don't want to download a lot of info to the smartphone, just to throw it away later (unless you have a flat-rate data plan for your smartphone, and I don't).
And when we have to code the filtering, we may just as well add the code to provide the data in a standardized format. Something similar to the xymondxboard output, probably.
Regards, Henrik
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon