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