[Xymon] Android 2.2 App

netz-haut - stephan seitz s.seitz at netz-haut.de
Thu Nov 3 16:17:04 CET 2011


Hi there,

nice to see there's a discussion starting about an API.
I wasn't aware of the [hobbit|xymon]dboard command, but after a few tests, I found an
hobbitdxboard on my (obviously) older hobbit/xymon server. I don't know if that xboard
command made it into newer xymon, it returns a self-explanatory XML structure, which
could be easily parsed.
Put an additional XML Header, add a DTD and you're finally done  

Inspired by your scriptlet, I've done a very similar one:

#!/bin/sh
echo "Content-type: text/xml"
echo ""
/usr/lib/hobbit/server/bin/bb localhost "hobbitdxboard $QUERY_STRING"






-- 

Stephan Seitz
Senior System Administrator

   netz-haut GmbH
   multimediale kommunikation

   Zweierweg 22
   97074 Würzburg

   Telefon: 0931 2876247
   Telefax: 0931 2876248

   Web: www.netz-haut.de

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



Am Donnerstag, den 03.11.2011, 09:29 -0400 schrieb Ralph Mitchell:


	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
		
		



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20111103/ba6c08f2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: face-wink.png
Type: image/png
Size: 919 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20111103/ba6c08f2/attachment.png>


More information about the Xymon mailing list