How to retrieve the global state of Xymon?
list Wim Nelis
Hello,
my current project is (trying to) display the global state of Xymon, that is the state (colour) shown in the main view. A sort of a traffic light is used, which is controlled by an ESP8266 micro controller running microPython.
This state must be determined from the states of all the tests, which can be retrieved using the 'xymondboard' command. As far as I know, there is no other way of retrieving the global state of Xymon. Is this correct?
The NOPROP* tags seem complicate things. One can retrieve the tag(s) per host, using f.i. 'xymondboard fields=...,XMH_NOPROPRED', but the tag is shown, not the result of combining it with the command line parameters of xymongen. Is there another way of retrieving this information?
Kind regards,
Wim Nelis.
list Tom Schmidt
You could simply look for the '<BODY class="green">' line in the ~xymon/server/www/nongreen.html or xymon.html file. The color shown for the "class" will match the overall state. A simple script could be written to run on your xymon server to gather this and send it to your monitor. Tom On Fri, Feb 16, 2024 at 8:16?AM Wim Nelis via Xymon <xymon at xymon.com> wrote:
---------- Forwarded message ---------- From: Wim Nelis <user-5c5b902249f8@xymon.invalid> To: xymon at xymon.com Cc: Bcc: Date: Fri, 16 Feb 2024 15:48:14 +0100 Subject: How to retrieve the global state of Xymon?
▸
Hello,
my current project is (trying to) display the global state of Xymon, that
is the state (colour) shown in the main view. A sort of a traffic light is
used, which is controlled by an ESP8266 micro controller running
microPython.
This state must be determined from the states of all the tests, which can
be retrieved using the 'xymondboard' command. As far as I know, there is no
other way of retrieving the global state of Xymon. Is this correct?
The NOPROP* tags seem complicate things. One can retrieve the tag(s) per
host, using f.i. 'xymondboard fields=...,XMH_NOPROPRED', but the tag is
shown, not the result of combining it with the command line parameters of
xymongen. Is there another way of retrieving this information?
Kind regards,
Wim Nelis.
---------- Forwarded message ----------
From: Wim Nelis via Xymon <xymon at xymon.com>
To: xymon at xymon.com
Cc:
Bcc:
Date: Fri, 16 Feb 2024 15:48:14 +0100
Subject: [Xymon] How to retrieve the global state of Xymon?
list Jeremy Laidman
It's also possible to get the colour from the <TITLE> tag in the <HEAD>
section. The colour is shown immediately after <TITLE>. This is how the old
BBTray tool finds the colour to display in the Windows system tray. I'd
recommend using Tom's technique, but there's a chance your ESP-based client
might (for some reason?) find it easier to parse <TITLE> rather than <BODY>.
In case it wasn't clear, the overall Xymon status is reflected in the
colour of (and tagged within) the main page ("/index.html" or "/") as well
as the non-green page ("/nongreen.html"). If you only want the colour, then
fetching one of these pages and parsing out the colour from the TITLE or
BODY tags is going to be the simplest way.
J
▸
On Sat, 17 Feb 2024 at 03:10, Tom Schmidt <user-d34f6118b459@xymon.invalid> wrote:
You could simply look for the '<BODY class="green">' line in the ~xymon/server/www/nongreen.html or xymon.html file. The color shown for the "class" will match the overall state. A simple script could be written to run on your xymon server to gather this and send it to your monitor. Tom On Fri, Feb 16, 2024 at 8:16?AM Wim Nelis via Xymon <xymon at xymon.com> wrote:---------- Forwarded message ---------- From: Wim Nelis <user-5c5b902249f8@xymon.invalid> To: xymon at xymon.com Cc: Bcc: Date: Fri, 16 Feb 2024 15:48:14 +0100 Subject: How to retrieve the global state of Xymon? Hello, my current project is (trying to) display the global state of Xymon, that is the state (colour) shown in the main view. A sort of a traffic light is used, which is controlled by an ESP8266 micro controller running microPython. This state must be determined from the states of all the tests, which can be retrieved using the 'xymondboard' command. As far as I know, there is no other way of retrieving the global state of Xymon. Is this correct? The NOPROP* tags seem complicate things. One can retrieve the tag(s) per host, using f.i. 'xymondboard fields=...,XMH_NOPROPRED', but the tag is shown, not the result of combining it with the command line parameters of xymongen. Is there another way of retrieving this information? Kind regards, Wim Nelis. ---------- Forwarded message ---------- From: Wim Nelis via Xymon <xymon at xymon.com> To: xymon at xymon.com Cc: Bcc: Date: Fri, 16 Feb 2024 15:48:14 +0100 Subject: [Xymon] How to retrieve the global state of Xymon?
list Wim Nelis
It's also possible to get the colour from the
list Henrik Størner
Another possibility is to fetch the Xymon "board" data from xymond. If you run a command
xymon XYMONSERVERIP "xymondboard color=red"
it will retrieve all of the "status red" items. Similar with yellow (and the other colors). Add a "| wc -l" and you get the number of items.
Regards,
Henrik
Xymon@xymon.com