Xymon Mailing List Archive search

How to query all red systems ignoring nopropred hosts

list Japheth Cleaver
Wed, 27 Jan 2016 10:42:04 -0800
Message-Id: <user-be4e18de7efa@xymon.invalid>

On Wed, January 27, 2016 9:35 am, user-9219fb9415b1@xymon.invalid wrote:
Hi

for creating an interface to another monitoring system I want to query the
xymon server for a list of all currently red systems.
I can do this with the xymon utility:

xymon 127.0.0.1 "xymondboard color=RED"

But this lists also hosts which have the nopropred tag set and I want to
ignore these. The only way I found was querying the config for each red
host and search for the tag myself. This can result in very much queries
to the xymon server if there are currently much red states.

Is there a nicer way to realize this? Maybe I have missed a filter option.
Or maybe I can see the tag in some field supported by the xymondboard's
output.
There's no direct way to do a != on XMH_* fields (although this is
something that should be added, to be honest), however you can either
check for the contents of the tag itself, or use the old filter pipeline
approach.

Unfortunately, the actual *calculation* of the NOPROP.* effects is done
entirely within xymongen, not xymond, so matching tests, wildcards,
includes and excludes would have to be done by hand.


This one will give you all those with any values there at all:

xymon localhost 'xymondboard color=red XMH_NOPROPRED=.'


This works for any xymon-xmh(5) tag; these can also be used in field
output, so you can also just examine the entire (parsed) config line:

xymon localhost 'xymondboard color=red fields=hostname,test,XMH_RAW' |
grep -i -v noprop


HTH,
-jc