I've been working to create a new MacOS Xymon Client since the last iteration I can find is using MacPorts and it's from 2015. I've tried both Python and Powershell using Homebrew and I've settled on Powershell. I may convert it to Python later once I get it finalized. It's just a single script that gathers host data and sends it to the server without any 2-way communication or client-local.cfg handshake stuff going on. I have data being sent successfully from a Mac laptop and the server is displaying everything fine with graphs and text outputs. But the server isn't applying the analysis.cfg tolerances to the host and I don't know why. Is there some magic piece of code that I'm overlooking or don't know exists that tells the server to compare the data to the tolerances in analysis.cfg?
My MacPSclient.ps1 is sending it's data in this format, but the status is always green on the server. "status $hostname.cpu green\n$cpuData"
This also works, but the status is always green. "status $hostname.cpu green $timestamp $cpuData"
This also works, but the status is always green. "status $hostname.disk green\n[disk]\n$diskUsageToSend"
I can change the word green to yellow and it changes the color on the server, but if I remove the word green, no data is updated on the server side when the script is ran. So I'm assuming the color tag is required. I've attempted to read how-to's, looked in other client scripts for a clue, and searched in forums, but I'm not finding anything. Can someone here help?
Thanks so much!
-- Kris Springer
The analysis.cfg thresholds are applied in central mode. If you are operating in local mode (which you appear to be, as you are sending status messages from the client) then the CPU thresholding needs to be done on the client.
In central mode, the xymond_client process parses client messages for relevant sections (eg [df] for disk data, [uptime] for CPU load averages) and performs thresholding checks against settings in analysis.cfg. It's my understanding that in local mode, the xymond_client process runs on the client side, so if you're implementing a full client that runs in local mode, you have to replicate the behaviour of xymond_client.
It's far simpler to make a client that runs only in central mode. You construct a client message consisting of all of the sections you're interested in, and send it to the server for it to parse for thresholding and extracting metrics for rrd files. The structure of the client message contents is important, as the parser expects the sections to be in a format that matches the OS ID of the client ("darwin" for MacOS?).
J
On Wed, 10 July 2024, 07:28 Kris Springer, <kspringer@innovateteam.com> wrote:
I've been working to create a new MacOS Xymon Client since the last iteration I can find is using MacPorts and it's from 2015. I've tried both Python and Powershell using Homebrew and I've settled on Powershell. I may convert it to Python later once I get it finalized. It's just a single script that gathers host data and sends it to the server without any 2-way communication or client-local.cfg handshake stuff going on. I have data being sent successfully from a Mac laptop and the server is displaying everything fine with graphs and text outputs. But the server isn't applying the analysis.cfg tolerances to the host and I don't know why. Is there some magic piece of code that I'm overlooking or don't know exists that tells the server to compare the data to the tolerances in analysis.cfg?
My MacPSclient.ps1 is sending it's data in this format, but the status is always green on the server. "status $hostname.cpu green\n$cpuData"
This also works, but the status is always green. "status $hostname.cpu green $timestamp $cpuData"
This also works, but the status is always green. "status $hostname.disk green\n[disk]\n$diskUsageToSend"
I can change the word green to yellow and it changes the color on the server, but if I remove the word green, no data is updated on the server side when the script is ran. So I'm assuming the color tag is required. I've attempted to read how-to's, looked in other client scripts for a clue, and searched in forums, but I'm not finding anything. Can someone here help?
Thanks so much!
-- Kris Springer
Xymon mailing list -- xymon@xymon.com To unsubscribe send an email to xymon-leave@xymon.com
Understood, and thanks for the info. I thought it might be something like that. The problem is that there isn't a modern functioning MacOS xymon client that uses the xymond_client process. All the math is wrong in the 2015 version. The cpu, mem, and disk checks are all different in the modern MacOS versions than they were 10 years ago. For whatever reason Xymon has seemed to ignore that Mac's need monitored too. I've got a good script that produces good data, but it's not using any xymond_client process. I'd be happy to share my code with anyone who can assist with getting this working the 'correct' way. We could wrap it up into an App.dmg for easy install. Then we'll finally have a MacOS client available just like we already have the Windows PS client and the Linux clients.
Kris Springer
On July 9, 2024 10:01:28 PM Jeremy Laidman <jeremy@laidman.org> wrote:
The analysis.cfg thresholds are applied in central mode. If you are operating in local mode (which you appear to be, as you are sending status messages from the client) then the CPU thresholding needs to be done on the client.
In central mode, the xymond_client process parses client messages for relevant sections (eg [df] for disk data, [uptime] for CPU load averages) and performs thresholding checks against settings in analysis.cfg. It's my understanding that in local mode, the xymond_client process runs on the client side, so if you're implementing a full client that runs in local mode, you have to replicate the behaviour of xymond_client.
It's far simpler to make a client that runs only in central mode. You construct a client message consisting of all of the sections you're interested in, and send it to the server for it to parse for thresholding and extracting metrics for rrd files. The structure of the client message contents is important, as the parser expects the sections to be in a format that matches the OS ID of the client ("darwin" for MacOS?).
J
On Wed, 10 July 2024, 07:28 Kris Springer, <kspringer@innovateteam.com> wrote:
I've been working to create a new MacOS Xymon Client since the last iteration I can find is using MacPorts and it's from 2015. I've tried both Python and Powershell using Homebrew and I've settled on Powershell. I may convert it to Python later once I get it finalized. It's just a single script that gathers host data and sends it to the server without any 2-way communication or client-local.cfg handshake stuff going on. I have data being sent successfully from a Mac laptop and the server is displaying everything fine with graphs and text outputs. But the server isn't applying the analysis.cfg tolerances to the host and I don't know why. Is there some magic piece of code that I'm overlooking or don't know exists that tells the server to compare the data to the tolerances in analysis.cfg?
My MacPSclient.ps1 is sending it's data in this format, but the status is always green on the server. "status $hostname.cpu green\n$cpuData"
This also works, but the status is always green. "status $hostname.cpu green $timestamp $cpuData"
This also works, but the status is always green. "status $hostname.disk green\n[disk]\n$diskUsageToSend"
I can change the word green to yellow and it changes the color on the server, but if I remove the word green, no data is updated on the server side when the script is ran. So I'm assuming the color tag is required. I've attempted to read how-to's, looked in other client scripts for a clue, and searched in forums, but I'm not finding anything. Can someone here help?
Thanks so much!
-- Kris Springer
Xymon mailing list -- xymon@xymon.com To unsubscribe send an email to xymon-leave@xymon.com
Xymon mailing list -- xymon@xymon.com To unsubscribe send an email to xymon-leave@xymon.com
I'm happy to help if I can, although I don't have a mac.
I think what you're saying is that the tools used to extract system metrics (ps, netstat, uptime) have different output from what they used to have when the Darwin client was written. If so, either the xymond_client code needs to be adjusted, or the output from the tools need to be reformatted to match what xymond_client expects. I think the latter is easier, but longer term, perhaps Xymon probably should see modern MacOS as a different OS to Darwin?
Can you provide the output of running xymonclient-darwin.sh? We can take a look at how different the output is to what the parser expects, and what tweaks we could make to re-align. Also, what does "uname -s" show?
Do you want the client to run in local or central mode? Ideally, we end up with a client that supports both, but for now, what's your preference?
J
On Wed, 10 July 2024, 14:36 Kris Springer, <kspringer@innovateteam.com> wrote:
Understood, and thanks for the info. I thought it might be something like that. The problem is that there isn't a modern functioning MacOS xymon client that uses the xymond_client process. All the math is wrong in the 2015 version. The cpu, mem, and disk checks are all different in the modern MacOS versions than they were 10 years ago. For whatever reason Xymon has seemed to ignore that Mac's need monitored too. I've got a good script that produces good data, but it's not using any xymond_client process. I'd be happy to share my code with anyone who can assist with getting this working the 'correct' way. We could wrap it up into an App.dmg for easy install. Then we'll finally have a MacOS client available just like we already have the Windows PS client and the Linux clients.
Kris Springer
On July 9, 2024 10:01:28 PM Jeremy Laidman <jeremy@laidman.org> wrote:
The analysis.cfg thresholds are applied in central mode. If you are operating in local mode (which you appear to be, as you are sending status messages from the client) then the CPU thresholding needs to be done on the client.
In central mode, the xymond_client process parses client messages for relevant sections (eg [df] for disk data, [uptime] for CPU load averages) and performs thresholding checks against settings in analysis.cfg. It's my understanding that in local mode, the xymond_client process runs on the client side, so if you're implementing a full client that runs in local mode, you have to replicate the behaviour of xymond_client.
It's far simpler to make a client that runs only in central mode. You construct a client message consisting of all of the sections you're interested in, and send it to the server for it to parse for thresholding and extracting metrics for rrd files. The structure of the client message contents is important, as the parser expects the sections to be in a format that matches the OS ID of the client ("darwin" for MacOS?).
J
On Wed, 10 July 2024, 07:28 Kris Springer, <kspringer@innovateteam.com> wrote:
I've been working to create a new MacOS Xymon Client since the last iteration I can find is using MacPorts and it's from 2015. I've tried both Python and Powershell using Homebrew and I've settled on Powershell. I may convert it to Python later once I get it finalized. It's just a single script that gathers host data and sends it to the server without any 2-way communication or client-local.cfg handshake stuff going on. I have data being sent successfully from a Mac laptop and the server is displaying everything fine with graphs and text outputs. But the server isn't applying the analysis.cfg tolerances to the host and I don't know why. Is there some magic piece of code that I'm overlooking or don't know exists that tells the server to compare the data to the tolerances in analysis.cfg?
My MacPSclient.ps1 is sending it's data in this format, but the status is always green on the server. "status $hostname.cpu green\n$cpuData"
This also works, but the status is always green. "status $hostname.cpu green $timestamp $cpuData"
This also works, but the status is always green. "status $hostname.disk green\n[disk]\n$diskUsageToSend"
I can change the word green to yellow and it changes the color on the server, but if I remove the word green, no data is updated on the server side when the script is ran. So I'm assuming the color tag is required. I've attempted to read how-to's, looked in other client scripts for a clue, and searched in forums, but I'm not finding anything. Can someone here help?
Thanks so much!
-- Kris Springer
Xymon mailing list -- xymon@xymon.com To unsubscribe send an email to xymon-leave@xymon.com
Xymon mailing list -- xymon@xymon.com To unsubscribe send an email to xymon-leave@xymon.com
participants (2)
-
Jeremy Laidman
-
Kris Springer