There are a number of packages for Zabbix in OpenWrt, as listed on administration---zabbix.
In OpenWrt the zabbix-agentd is a standard Zabbix 7.0.9 agent (for OpenWrt 24.10.0 through 24.10.4, at least) whose configuration is detailed in the upstream Zabbix documentation. In OpenWrt, however, there are three precompiled 'flavors': the base (no SSL) agent, the agent with GnuTLS for SSL, and the agent with OpenSSL for SSL.
In OpenWrt 25.12 the user under which the agent runs has been changed from `zabbix` to `zabbix-agent` and you have to add `User=zabbix-agent` to `zabbix_agentd.conf`, otherwise your system log will be flooded with
daemon.err: zabbix_agentd[8071]: zabbix_agentd [8071]: user zabbix does not exist
daemon.err: zabbix_agentd[8071]: zabbix_agentd [8071]: cannot run as root!
The Zabbix Server packages (for the same three flavors as the agent) in OpenWrt currently do not have a procd initscript, so here is one you can use until one is added to the package (add as /etc/init.d/zabbix_server and issue /etc/init.d/zabbix_server enable. You will likely also want to add /etc/init.d/zabbix_server to /etc/sysupgrade.conf in order to preserve the initscript during a sysupgrade).
Note: This script expects /etc/zabbix_server.conf to contain a directive PidFile=/etc/zabbix/zabbix_server.pid
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2011 OpenWrt.org
START=59
USE_PROCD=1
PROG=/usr/sbin/zabbix_server
CONFIG=/etc/zabbix_server.conf
mkdir -p /run/zabbix
chown zabbix:zabbix /run/zabbix
chown zabbix:zabbix ${CONFIG}
start_service() {
[ -f ${CONFIG} ] || return 1
procd_open_instance
procd_set_param command ${PROG} -c ${CONFIG} -f
procd_set_param limits nofile="16384 100000"
procd_set_param file ${CONFIG}
procd_set_param user zabbix
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
The web interface for Zabbix is in the package zabbix-server-frontend. It is not configured by default and takes some work to get setup. For a tutorial on this, see frontend_tutorial.
There are 3 'extra' packages for zabbix that add userparameters and detections rules for zabbix-agentd:
Here follow Zabbix templates for Openwrt
“Template Openwrt Mac80211” (for zabbix-extra-mac80211): http://pastebin.com/3iWQq2kc
“Template Openwrt Network” (for zabbix-extra-network): http://pastebin.com/5Jcg7w9j
“Template Openwrt Wifi” (for zabbix-extra-wifi): http://pastebin.com/uWtWT6C8
“All in one”: http://pastebin.com/nQdZM89w
Relevant commit: https://dev.openwrt.org/changeset/36740
By default, Zabbix does not monitor flash filesystems such as ubifs or f2fs. Here is how to monitor them.
In the Zabbix web UI:
^(btrfs|ext2|ext3|ext4|f2fs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|ubifs|zfs)${$VFS.FS.FSTYPE.MATCHES} to be ^(btrfs|ext2|ext3|ext4|f2fs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|ubifs|zfs)$