Zabbix network monitoring

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.

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:

  • zabbix-extra-network: a detection rule with the ifname (eth0.1) and the network name (wan)
  • zabbix-extra-wifi: an universal detection rule for wifi (using libuci-lua) and many userparameters (using libiwinfo-lua)
  • zabbix-extra-mac80211: a phy (phy0) detection rule and userparameters for mac80211 devices

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:

  1. Select 'Administration|General|Regular expressions'
  2. Update 'Filesystems for discovery to include f2fs|ubifs (E.g. update 'Expressions' to ^(btrfs|ext2|ext3|ext4|f2fs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|ubifs|zfs)$
  3. Select 'Update'
  4. Clone 'Data collection|templates|Linux by Zabbix agent' (and/or 'Data collection|templates|Linux by Zabbix agent active') as 'Data collection|Templates|Linux on OpenWrt by Zabbix agent'
  5. Select 'Data collection|Templates|Linux on OpenWrt by Zabbix agent'
  6. Select 'Macros'
  7. Edit {$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)$
  8. Select 'Update'
  9. Optional: Repeat this for host macros
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2025/12/02 08:29
  • by danielfdickinson1