[Xymon] Enable/disable by class

Galen Johnson Galen.Johnson at sas.com
Wed Feb 5 07:14:23 CET 2014


Thanks, Jeremy...I took a stab at it but I'm no developer (just a lowly sys admin).  I have to be missing something.  The attached patch is what I attempted.  It doesn't appear to break existing functionality but if you actually attempt to use the class filter, it fails.  I can't get any useful output to figure out what I've missed.  I suspect it has to do with your comment about fetch_board since I really don't understand what you're saying and the code itself doesn't seem to be anything obvious for how it's handling the other XMH types.  Note, the patch was made against 4.3.15.  It does compile cleanly.

Any assistance here would be appreciated.

=G=

________________________________
From: Jeremy Laidman <jlaidman at rebel-it.com.au>
Sent: Tuesday, February 4, 2014 6:51 PM
To: Galen Johnson
Cc: xymon at xymon.com
Subject: Re: [Xymon] Enable/disable by class

On 5 February 2014 08:49, Galen Johnson <Galen.Johnson at sas.com<mailto:Galen.Johnson at sas.com>> wrote:
Pretty sure this isn't currently possible but what would it take to have the enable/disable script to allow en/disabling by class?  Or even just being able to select the set of hosts based on class?

Interesting idea.  You could enhance maint_form to include the option, possibly in the "Filter hostlist" section, and adjust enadis.c to process it.  The host list is populated from a xymondboard search, so you could use anything that that returns, such as XMH_NET, XMH_OS, XMH_DGNAME (group name) or XMH_PAGENAME, and filter based on that.  What you're looking for is XMH_CLASS.

The data for matching is retrieved by a call to fetch_board() (in lib/headfoot.c), which uses this xymondboard search: "xymondboard fields=hostname,testname,disabletime,dismsg".  You'd have to add on "XMH_CLASS" to that, and then adjust the parsing code to handle and store the class string to be matched against.  The actual filtering is also done in lib/headfoot.c, in the function wanted_host(), so you'd need to add a bit of code to compare the host class against the filter string.

Cheers
Jeremy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140205/cdb38871/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enadis_class_filter.patch
Type: application/octet-stream
Size: 9028 bytes
Desc: enadis_class_filter.patch
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140205/cdb38871/attachment.obj>


More information about the Xymon mailing list