Part 112: Monitor your Apple Silicon with Zabbix

What's up, home? part 112 cover image

In my previous post I did show some command-line tools that could be useful for showing interesting metrics about your Mac. I also told that in the follow-up post I would show you how to monitor your Apple Silicon (with that, I mean Apple M-series chips CPU/GPU/ANE [Apple Neural Engine]) with Zabbix.

I'm almost successful with that, but then still embarrassingly far. This has not been my most successful project so far. I am sure there would be so many better ways -- if so, please let me know! 

Here's what has happened.

I made an amateur mistake with macOS Sequoia 15.3.1

Zabbix agent has been working fine for me for several years on my macOS. However, with the latest macOS Sequoia 15.3.1 it decided to throw me this:

zabbix_agentd- Not Opened

The usual "Go to Finder, try to open Zabbix agent from there" did not help, and neither did downloading the agent from zabbix.com and reinstalling it, so the inpatient me already moved on to create a cronjob which runs powermetrics every minute and sends the results to my Zabbix over HTTP history.push(). It basically just sends the output of this to my Zabbix:

powermetrics --samplers cpu_power,gpu_power,ane_power -n1 -f plist

The fix to Zabbix agent, or any similar dialog on macOS Sequoia

A wiser version of me would have clicked on that question mark icon there. It says that if I go to System Settings --> Privacy & Security, by scrolling on that menu I can then find a section which shows "Open Zabbix agent anyway" button. Not very intuitive, but at least from there it's then possible to grant the permission to run the thing.

Adding to Zabbix

Even if now my Zabbix agent could read a text file produced by powermetrics, for now I have the history.push() thing going on. It pushes the plist file to a text raw item:

Raw item

Then, grabbing the values with regexp (XML XPath might also work, but for this experiment didn't try to remember how to do that) with few dependent items and item preprocessing:

Extracting ANE energy

Or just the regular expression:

<key>ane_energy<.key>\s*<integer>(\d+)<.integer>

Monitoring CPU/GPU/ANE power and energy

To try out if any of this works, I added monitoring of CPU/GPU/ANE power and energy. For the energy, I get consistent results. For power (which would be in mW), I get lots of missing data, which is weird. See, here's the energy usage:

CPU/GPU/ANE energy usage graph

... and here's the power usage:

CPU/GPU/ANE power usage

But, even with all the weirdness, this is useful/informational already. On that energy graph, it's easy to see when I did run DrawThings as the green line spikes heavily.

Time for dashboard

... and here's my dashboard so far. I'll try to figure out why the data is so spotty (I might migrate to Zabbix agent now that I got it running again), and if I get things working smoothly, then I move on to adding things like chip frequencies to this experiment.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Buy me a coffee

Like these posts? Support the project and Buy me a coffee