FreeBSD template pfSense-oriented:
PfSense Monitoring with Integrated Zabbix Agent
Nothing special, just import both templates, create the host for pfSense and link it to the appropriate template (active or passive).
In Zabbix agent config on pfSense, you must display the advanced configuration options and add to the User Parameters field that just appeared:
UserParameter=pfsense.states.max,grep "limit states" /tmp/rules.limits | cut -f4 -d ' '
UserParameter=pfsense.states.current,grep "current entries" /tmp/pfctl_si_out | tr -s ' ' | cut -f4 -d ' '
UserParameter=pfsense.mbuf.current,netstat -m | grep "mbuf clusters" | cut -f1 -d ' ' | cut -d '/' -f1
UserParameter=pfsense.mbuf.cache,netstat -m | grep "mbuf clusters" | cut -f1 -d ' ' | cut -d '/' -f2
UserParameter=pfsense.mbuf.max,netstat -m | grep "mbuf clusters" | cut -f1 -d ' ' | cut -d '/' -f4
Commands used:
grep
: filter text by pattern.netstat
: show network status.cut
: cut out selected portions of each line.tr
: replace characters (used here to replace the space sequences with a single space, necessary in some cases to properly use the cut
command).In Zabbix Agent config (on pfSense) you may need to increase the timeout value (set to 3 seconds by default). It is certainly the first thing to check on Zabbix Agent if you find yourself unable to retrieve some User Parameters metrics.
The link with this template has been remove for the "Active" version does not exist by default in Zabbix. Do not forget to add it in the linked templates.
ps: you may create an "Active" template version by cloning the "Passive" one and changing the type of items.