Connecting Zabbix Agent 2 to the Wiren Board MQTT Broker
Introduction
Zabbix Agent 2 is a program that monitors and produces statistics on the operation of local resources. It can obtain data on its own and send it to the Zabbix Server, either automatically or only on request from the server. Zabbix Agent 2 has a built-in MQTT plugin for working with MQTT brokers. The agent version must be at least 6.0.39rc1 or 7.0.10rc1 (current is 7.4) — these fix MQTT subscription bugs.
This article describes how to configure Zabbix Agent 2 to collect data from a Wiren Board controller. Zabbix Agent 2 can be installed either on the computer that runs Zabbix Server or on another computer on the network, including the controller itself. Zabbix Server must already be installed — see more on the official Zabbix website.
Templates
For convenience, you can use the ready-to-use Zabbix templates for Wiren Board devices.
Installation and connecting to the broker
- Install Zabbix Agent 2 and connect it to Zabbix Server, download link and installation guide
- Add an Item with the settings:
- Name — a name
- Type — Zabbix Agent (active)
- Key — mqtt.get[broker,topic,username,password], a subscription to an MQTT broker topic, where:
- broker —
"protocol://ip-address:port". - topic — the path to the MQTT broker topic
"devices/XX/controls/XX". - username, password — the MQTT broker login and password, if required.
- Example of a key for subscribing to the Vin topic of a Wiren Board controller
mqtt.get["tcp://192.168.50.216:1883", "/devices/power_status/controls/Vin"]
- broker —
- Type of information — the type of the value received from the MQTT broker.
- Units — the units of the value received from the MQTT broker.
- Example of configuring and subscribing to a topic
Installing on the controller
Wiren Board controllers (WB7, WB8) run on the armhf and arm64 architectures.
In the official Debian Zabbix repository, the zabbix-agent2 package is built only for
amd64, so apt install zabbix-agent2 from there will not find a candidate on the controller.
A working option is the Zabbix repository for Raspberry Pi OS: it is built for arm64 and armhf,
and Raspberry Pi OS bullseye matches the Wiren Board firmware in its base libraries (glibc 2.31),
so the package installs without rebuilding. The commands are the same for WB7 and WB8 — apt
picks the right build itself (arm64/armhf).
1. Add the Zabbix repository (Raspberry Pi OS option):
wget https://repo.zabbix.com/zabbix/7.4/release/raspbian/pool/main/z/zabbix-release/zabbix-release_latest_7.4+debian11_all.deb
dpkg -i zabbix-release_latest_7.4+debian11_all.deb
apt update
2. Install the agent:
apt install zabbix-agent2
If needed, you can install additional plugins, for example:
zabbix-agent2-plugin-postgresql, zabbix-agent2-plugin-mongodb,
zabbix-agent2-plugin-mssql.
3. Enable autostart and start the service:
systemctl enable --now zabbix-agent2
4. Verify the installation:
zabbix_agent2 --version # expected: Zabbix Agent2 7.4.x
systemctl status zabbix-agent2 # active (running)
ss -tlnp | grep 10050 # the agent listens on port 10050
5. Set the Zabbix server address.
Open /etc/zabbix/zabbix_agent2.conf and set the parameters for your server:
Server=<Zabbix_server_IP>
ServerActive=<Zabbix_server_IP>
Hostname=<controller_name>
After changing the configuration, restart the service:
systemctl restart zabbix-agent2