Part 63: Zabbix the AI artist
Maybe you'd like to have a random desktop background picture? Or one of your dashboards would need a changing image? Let the alerts flowing in to your alerting system be your artist.
Maybe you'd like to have a random desktop background picture? Or one of your dashboards would need a changing image? Let the alerts flowing in to your alerting system be your artist.
As I am now entering the dungeons of Generative AI, of course I'm having some fun. Instead of just analyzing a single alert through Zabbix manual actions, how about using the Zabbix API and the official zabbix_utils for querying the active alerts and feeding the list to GPT4All?
I just integrated my Zabbix with locally running generative AI in five minutes. You could do it, too. Here's how.
For my test, I'm using GPT4All, or its Python libraries. Install it with
pip install gpt4allNext, I took one of their example scripts and added very primitive command line argument handling. Here's the full Python script.
Ever since I started my What's up, home? project back in the spring of 2022, the Raspberry Pi 4 I bought back then has been running on Raspberry OS 11 -- or, a rebranded Debian 11 with a splash of love to make it perfect for these little credit-card sized computer marvels.
Today I took a brave step and upgraded my Raspberry Pi to Rasberry Pi OS 12, or again, to modified Debian 12. Even though Debian 12 has been out for some time now, Raspberry Pi OS 12 only came out late last year.
As Zabbix 7.0 will come with the new widget framework, allowing communication between different widgets on dashboards, of course I had to try it out.
The blog post title is a bit of a clickbait in a sense that this example is just 1:1 from Zabbix Summit 2023 custom widgets workshop session. I made some very, very minor modifications to code, mainly just changed my name and so on to manifest.json files. Since the code itself was obtained from the workshop session, I'm not going to publish it, but this much I will tease:
Since I will have some real use for Zabbix 7.0 when it comes out, I figured out that maybe it's time to switch my What's up, home? main instance to run on Zabbix 7.0beta1. Actually, I first upgraded to Zabbix 7.0alpha9 early yesterday, but then 7.0beta1 got released later in the evening before I had time to play around with alpha9.
Anyway, now my Raspberry Pi 4 is running the latest-and-greatest version of Zabbix. A possible bumpy ride ahead, but I'm ready!
Can you control your lights with Zabbix? Of course you can!
As I told during my Zabbix Summit 2023 speech, there will be a blog series about how I control my home with Zabbix. Let's start with how I control my home office lights -- or any light connected to our Cozify -- with it.
First of all, in Cozify I have the office light (Philips Hue) like this.
In December, my wife told my how she's annoyed about one Finnish company which tends to change its product prices out of nowhere all the time. To visualize this, of course I added a random product from that company's website to my dear What's up, home? monitoring.
The products in question are not complex to manufacture, and are not dependent on terribly fluctuating things like chip availability, oil prices or similar factors. Anyway, the price randomness is very real - the price varies between 23.90 EUR and 59.90 EUR.
This is the difference in I/O wait times after I replaced the faulty Raspberry Pi memory card to brand new one.

So, from about 8-9 seconds AVERAGES to back almost non-existent! Yay!
Now almost a year ago I blogged about my nine months of experience with running Zabbix on Raspberry Pi 4. I guess it's time to revisit that a bit, as the probably soon-to-fail memory card that came with Raspberry is causing all kinds of issues, even though everything important like Zabbix database is stored on external USB drive.
My Raspberry Pi is still booting from the memory card that came with it. However, I have moved much of the stuff to external USB drive I have connected to Raspberry:
Like these posts? Support the project and Buy me a coffee