Xymon Mailing List Archive search

How to query all red systems ignoring nopropred hosts

3 messages in this thread

list Thorsten Erdmann · Wed, 27 Jan 2016 17:35:55 +0000 ·
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.

Thanks for help
Thorsten


If you are not the addressee, please inform us immediately that you have received this e-mail by mistake, and delete it. We thank you for your support.
list Japheth Cleaver · Wed, 27 Jan 2016 10:42:04 -0800 ·
quoted from Thorsten Erdmann
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
list Thorsten Erdmann · Wed, 27 Jan 2016 19:16:24 +0000 ·
Thank you JC,

The column XMH_NOPROPRED does it. I can then parse this and match it against the test column.
Direct parsing of the XMH_RAW column is difficult, because it generates a column for each test. So the number of columns is not constant. So I cannot detect which column is a test name and which is the following column:
xymon 127.0.0.1 "xymondboard color=RED fields=hostname,XMH_RAW,testname"
m068h0037545090|COMMENT:H21 Grossanzeige SGM7|conn
qda68|noconn|dbcheck|NOPROPRED:HitCache,Uptime,MemReq|dbcheck|HitCache
s068a015|COMMENT:QDA Erfassungsserver|testip|nopropred:app|app
s068tw000004|testip|conn|cpu|disk|memory|msgs|netstat|oracle|procs|svcs|COMMENT:T-Server SAP, MES|msgs
You see there are a different number of columns per line. So it is difficult to see if Hitcache is an entry of the host tags or the test which failed. (Ok, it's the last column, so you may count backwards or you can put the XMH_RAW column at the end)


Thorsten
quoted from Japheth Cleaver
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

If you are not the addressee, please inform us immediately that you have received this e-mail by mistake, and delete it. We thank you for your support.