<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.1.92">
</HEAD>
<BODY>
Hi there,<BR>
<BR>
nice to see there's a discussion starting about an API.<BR>
I wasn't aware of the [hobbit|xymon]dboard command, but after a few tests, I found an<BR>
hobbitdxboard on my (obviously) older hobbit/xymon server. I don't know if that xboard<BR>
command made it into newer xymon, it returns a self-explanatory XML structure, which<BR>
could be easily parsed.<BR>
Put an additional XML Header, add a DTD and you're finally done <IMG SRC="cid:1320333286.26027.44.camel@wotan2" ALIGN="middle" ALT=";)" BORDER="0"><BR>
<BR>
Inspired by your scriptlet, I've done a very similar one:<BR>
<BR>
#!/bin/sh<BR>
echo "Content-type: text/xml"<BR>
echo ""<BR>
/usr/lib/hobbit/server/bin/bb localhost "hobbitdxboard $QUERY_STRING"<BR>
<BR>
<BR>
<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 

Stephan Seitz
Senior System Administrator

   netz-haut GmbH
   multimediale kommunikation

   Zweierweg 22
   97074 Würzburg

   Telefon: 0931 2876247
   Telefax: 0931 2876248

   Web: <A HREF="http://www.netz-haut.de">www.netz-haut.de</A>

   Amtsgericht Würzburg – HRB 10764
   Geschäftsführer: Michael Daut, Kai Neugebauer

</PRE>
<BR>
<BR>
</TD>
</TR>
</TABLE>
Am Donnerstag, den 03.11.2011, 09:29 -0400 schrieb Ralph Mitchell:<BR>
<BLOCKQUOTE TYPE=CITE>
    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:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
         #!/bin/bash
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
         echo "Content-Type: text/plain"
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
         echo ""
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
         /home/xymon/server/bin/xymon localhost "xymondboard $QUERY_STRING"
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    then called it using curl:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
         curl -s -S -L "<A HREF="http://server.domain.com/xymon-cgi/xap.sh?color=red">http://server.domain.com/xymon-cgi/xap.sh?color=red</A>"<BR>
         curl -s -S -L "<A HREF="http://server.domain.com/xymon-cgi/xap.sh?color=yellow">http://server.domain.com/xymon-cgi/xap.sh?color=yellow</A>"<BR>
         curl -s -S -L "<A HREF="http://server.domain.com/xymon-cgi/xap.sh?color=purple">http://server.domain.com/xymon-cgi/xap.sh?color=purple</A>"<BR>
    <BR>
    Piping those through "wc" I get a total of 3305 bytes for all three.  Fetching the non-green page:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
         curl -s -S -L "<A HREF="http://server.domain.com/xymon/nongreen.html">http://server.domain.com/xymon/nongreen.html</A>"<BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    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.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    Ralph Mitchell
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    On Thu, Nov 3, 2011 at 7:55 AM, <<A HREF="mailto:henrik@hswn.dk">henrik@hswn.dk</A>> wrote:<BR>
    <BLOCKQUOTE>
        On Thu, 3 Nov 2011 07:01:32 -0400, Ralph Mitchell<BR>
        <<A HREF="mailto:ralphmitchell@gmail.com">ralphmitchell@gmail.com</A>><BR>
        wrote:
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        > Henrik, has the format of hobbitdboard / xymondboard changed much<BR>
        between<BR>
        > versions??  It would be fairly easy to make that available via a cgi<BR>
        script<BR>
        > and it would be easier to parse than html.<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        No, this format is fairly static - and you can make it entirely "fixed" by<BR>
        adding a "fields" option to select the data-items you are interested in.<BR>
        <BR>
        But to pick only the hosts that appear on a specific page must be done on<BR>
        the Xymon server - you don't want to download a lot of info to the<BR>
        smartphone, just to throw it away later (unless you have a flat-rate data<BR>
        plan for your smartphone, and I don't).<BR>
        <BR>
        And when we have to code the filtering, we may just as well add the code<BR>
        to provide the data in a standardized format. Something similar to the<BR>
        xymondxboard output, probably.<BR>
        <BR>
        <BR>
        Regards,<BR>
        <FONT COLOR="#888888">Henrik</FONT>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        _______________________________________________<BR>
        Xymon mailing list<BR>
        <A HREF="mailto:Xymon@xymon.com">Xymon@xymon.com</A><BR>
        <A HREF="http://lists.xymon.com/mailman/listinfo/xymon">http://lists.xymon.com/mailman/listinfo/xymon</A><BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
</BODY>
</HTML>