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

<code>telnet 192.168.99.55 10050</code>
<code>zabbix_get -s 192.168.99.55 -k agent.ping</code>

Add Custom Agent Commands

Edit

/usr/local/etc/zabbix_agentd.conf.d/opnsense_zabbix.conf

and add the following

UserParameter

definitions:

<code>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</code>

Test Custom Parameters

<code>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</code>

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.

monitoringOperationsAgenttemplateZabbixOPNsense
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

login 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.