How to retrieve the global state of Xymon?
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 <wim.nelis at ziggo.nl> 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?
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
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 <tom at 4schmidts.com> 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 <wim.nelis at ziggo.nl> 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?
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
An HTML attachment was scrubbed... URL: <http://lists.xymon.com/pipermail/xymon/attachments/20240218/477f8aff/attachment.htm>
participants (3)
-
jeremy@laidman.org
-
tom@4schmidts.com
-
wim.nelis@ziggo.nl