[Xymon] Enable/disable by class

Jeremy Laidman jlaidman at rebel-it.com.au
Wed Feb 5 00:51:26 CET 2014


On 5 February 2014 08:49, Galen Johnson <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/fe76980e/attachment.html>


More information about the Xymon mailing list