Operations 4 min read

Monitor OPNsense with Zabbix: Complete Template Installation Guide

This guide walks through downloading the pfSense Zabbix template, installing the os‑zabbix‑agent plugin on OPNsense, configuring custom agent parameters, testing connectivity, and setting up the host and template in Zabbix Server to monitor OPNsense metrics.

Ops Development Stories
Ops Development Stories
Ops Development Stories
Monitor OPNsense with Zabbix: Complete Template Installation Guide

Template Download

OPNsense is a fork of pfSense with the same infrastructure. To monitor OPNsense with Zabbix, use the pfSense template available from the GitHub repository.

Import the Template

Import zbx_template_pfsense.xml into Zabbix Server.

Add OPNsense Group

Create a host group for OPNsense devices.

Enable Zabbix Agent on OPNsense

Navigate to System → Firmware → Plugins , locate the os‑zabbix‑agent plugin and click the + button to install.

Execute the installation and restart the agent after configuration.

Configure Zabbix Agent

Go to Services → Zabbix Agent and set the required parameters, then restart the agent.

Test Agent Connectivity

telnet 192.168.99.55 10050
zabbix_get -s 192.168.99.55 -k agent.ping

Add Custom Agent Commands

Edit /usr/local/etc/zabbix_agentd.conf.d/opnsense_zabbix.conf and add the following UserParameter definitions:

vi /usr/local/etc/zabbix_agentd.conf.d/opnsense_zabbix.conf</code>
<code>UserParameter=pfsense.states.max,grep "limit states" /tmp/rules.limits | cut -f4 -d ' '</code>
<code>UserParameter=pfsense.states.current,grep "current entries" /tmp/pfctl_si_out | tr -s ' ' | cut -f4 -d ' '</code>
<code>UserParameter=pfsense.mbuf.current,netstat -m | grep "mbuf clusters" | cut -f1 -d ' ' | cut -d '/' -f1</code>
<code>UserParameter=pfsense.mbuf.cache,netstat -m | grep "mbuf clusters" | cut -f1 -d ' ' | cut -d '/' -f2</code>
<code>UserParameter=pfsense.mbuf.max,netstat -m | grep "mbuf clusters" | cut -f1 -d ' ' | cut -d '/' -f4

Test Custom Parameters

zabbix_get -s 192.168.99.55 -k pfsense.states.current</code>
<code>5</code>
<code>zabbix_get -s 192.168.99.55 -k pfsense.mbuf.current</code>
<code>541</code>
<code>zabbix_get -s 192.168.99.55 -k pfsense.mbuf.cache</code>
<code>729</code>
<code>zabbix_get -s 192.168.99.55 -k pfsense.mbuf.max</code>
<code>125376

Zabbix Server Configuration

Add a new host for the OPNsense device and attach the imported template.

After applying the template, the host appears online and starts showing data.

Latest monitoring data is displayed in the Zabbix dashboard.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

monitoringagenttemplateZabbixOPNsense
Ops Development Stories
Written by

Ops Development Stories

Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.