Skip to main content
RunBook Academy

OPNsenseXXXIV · Monitoring and Observability IntegrationSNMP and traditional monitoring

SNMP and traditional monitoring — the protocol that pre-dates Prometheus and still earns its place

Intermediate⏱ ~13 minsnmpwalksnmpgetsnmpd

What you'll learn

  • Configure the net-snmp daemon on OPNsense with v2c or v3 credentials
  • Describe MIBs and OIDs and how the operator reads them
  • List the standard IF-MIB and Host-Resources MIB objects that matter for an OPNsense operator
  • Recognise where SNMP fits alongside Prometheus and when to prefer one over the other

Prerequisites

Verified against OPNsense 25.x · FreeBSD 14.x · PF (FreeBSD packet filter) FreeBSD 14.x · Unbound 1.20+ · Kea DHCP OPNsense 25.x plugin · WireGuard in-kernel + OPNsense plugin · strongSwan (IPsec plugin) OPNsense 25.x plugin · OpenVPN 2.6.x · Suricata 7.x · 2026-08-14

Not yet marked complete on this device.

SNMP predates Prometheus by twenty years. SNMPv1 was published in 1988; Prometheus was released in 2012. In that gap, SNMP became the default protocol for routers, switches, printers, and UPSes — every device that wanted to be monitored at scale. The reason SNMP persists is not nostalgia: it is that every network device speaks it, every NMS knows how to poll it, and the protocol’s traps allow devices to push notifications without a persistent connection.

OPNsense supports SNMP via the net-snmp daemon. This lesson covers the daemon’s configuration, the v2c-versus-v3 question, the MIBs and OIDs the operator must know, and where SNMP fits in a modern stack alongside Prometheus.

Why SNMP, in 2026

The honest answer is: SNMP exists because every existing network management system supports it. The operator who runs Zabbix, LibreNMS, PRTG, Nagios, or any vendor NMS already has SNMP polling configured for the switches and routers. Adding the OPNsense firewall to the same NMS via SNMP requires zero new tooling. Prometheus, by contrast, requires deploying the exporter and building dashboards.

The trade-off is that SNMP’s data model is older and more awkward. Interface counters in SNMP are 32-bit and roll over at 4 Gbps; modern interfaces exceed this in seconds. Prometheus counters are 64-bit. SNMP traps are unreliable (UDP, no acknowledgement); Prometheus pushgateway is more robust. SNMPv2c sends the community string in cleartext; SNMPv3 fixes this but is harder to configure.

Configuring net-snmp on OPNsense

OPNsense ships the net-snmp package as a service. The configuration lives at Services → SNMP. The essential settings:

  • Enable — checkbox.
  • Location — free text, e.g. DC1, rack 12.
  • Contact — free text, e.g. noc@example.com.
  • Read community string (v2c) — the shared secret for read-only v2c access. Set to a non-default value.
  • SNMPv3 — username, auth protocol (SHA, MD5), auth password, priv protocol (AES, DES), priv password.

For most production deployments, SNMPv3 with SHA authentication and AES privacy is the right choice. SNMPv2c is acceptable on isolated management networks where the community string’s exposure is bounded.

The daemon listens on UDP port 161. The firewall rule on the management interface must allow UDP 161 from the NMS subnet.

MIBs and OIDs

SNMP exposes data as a hierarchical tree of identifiers. Each identifier is an OID (Object Identifier) — a dotted sequence of numbers like 1.3.6.1.2.1.2.2.1.10. The OID is the address; the value at that address is the data. MIBs (Management Information Bases) are the schema that translate OIDs into human names.

The two MIBs the operator must know:

IF-MIB (1.3.6.1.2.1.2.2.1.*) — the interfaces table. Every interface has an ifIndex; under each index are counters for bytes in (ifInOctets, OID …1.10), bytes out (ifOutOctets, OID …1.16), errors in (ifInErrors, OID …1.14), errors out (ifOutErrors, OID …1.20), drops in (ifInDiscards, OID …1.13), and so on.

Host-Resources MIB (1.3.6.1.2.1.25.*) — system resources. CPU load (hrProcessorLoad, OID …3.3.1.3), storage (hrStorageSize, hrStorageUsed), running processes.

Read-only / Safesnmpwalk ifInOctets
$ snmpwalk -v2c -c public 192.0.2.1 1.3.6.1.2.1.2.2.1.10
IF-MIB::ifInOctets.1 = Counter32: 1842315234
IF-MIB::ifInOctets.2 = Counter32: 321456890
IF-MIB::ifInOctets.3 = Counter32: 1876543210
IF-MIB::ifInOctets.4 = Counter32: 0

Illustrative output

The operator reads SNMP by walking subtrees and reading the values. Most NMSs do this automatically and present graphs; the underlying mechanism is the same.

SNMP traps

Polling is the operator-initiated query: the NMS asks “what is the value of ifInOctets?”. Traps are the device-initiated notification: the device says “the link on interface 4 went down”. OPNsense can be configured to send traps to a trap receiver (UDP port 162 by default) when certain events occur.

The OPNsense trap configuration supports:

  • Link up / link down on interfaces.
  • CARP state change (master ↔ backup).
  • System threshold events via the bsnmpd integration.
  • Custom traps via shell scripts.

Traps are unreliable — UDP, no acknowledgement, lost in transit. The operator who relies on traps for paging has gaps. Traps are useful for “nice to have” notifications; for paging, use a polled threshold.

Where SNMP fits alongside Prometheus

A modern monitoring stack uses both:

  • SNMP for the devices that speak only SNMP — switches, routers, printers, UPSes, the existing NMS’s existing devices.
  • Prometheus for the devices that have modern exporters — OPNsense, Linux servers, applications.

The two feed the same NMS dashboards. Zabbix and LibreNMS accept both; the operator can have a single dashboard showing Prometheus-sourced OPNsense metrics alongside SNMP-sourced switch and router metrics. The integration is straightforward — both protocols are polled, both produce time-series data, and the NMS renders both.

The OIDs an OPNsense operator must know

The minimum OID set:

OIDNameMeaning
1.3.6.1.2.1.2.2.1.10.<idx>ifInOctetsBytes received per interface
1.3.6.1.2.1.2.2.1.16.<idx>ifOutOctetsBytes sent per interface
1.3.6.1.2.1.2.2.1.13.<idx>ifInDiscardsInbound drops per interface
1.3.6.1.2.1.2.2.1.14.<idx>ifInErrorsInbound errors per interface
1.3.6.1.2.1.25.3.3.1.3.<cpu>hrProcessorLoadCPU utilisation per core
1.3.6.1.2.1.25.2.3.1.5.<idx>hrStorageUsedDisk used per storage
1.3.6.1.4.1.12325.1.200.1.2.1pfStateTableOPNsense-specific: state table count
1.3.6.1.4.1.12325.1.200.1.3.1pfStateSearchesOPNsense-specific: state searches
1.3.6.1.4.1.12325.1.200.1.4.1pfStateInsertsOPNsense-specific: state inserts

The first six are standard MIB-II / Host-Resources; the last three are the OPNsense enterprise tree (12325 is OPNsense’s IANA-registered enterprise number), which exposes PF state table data.

Read-only / Safesnmpget pfStateTable
$ snmpget -v3 -u monitor -l authPriv -a SHA -A 'authpw' -x AES -X 'privpw' 192.0.2.1 1.3.6.1.4.1.12325.1.200.1.2.1
iso.3.6.1.4.1.12325.1.200.1.2.1 = Gauge32: 3127

Illustrative output

Summary

  • SNMP persists because every network device speaks it and every NMS knows how to poll it.
  • OPNsense ships net-snmp; the configuration lives at Services → SNMP.
  • SNMPv3 with SHA auth and AES priv is the production default; v2c is acceptable only on isolated management networks.
  • The OIDs that matter: IF-MIB for interfaces, Host-Resources MIB for CPU/memory, OPNsense enterprise OIDs for PF state.
  • SNMP and Prometheus can run side-by-side; the NMS consumes both.

Knowledge check · 4 questions

  1. Q1. A new monitoring stack is being built for an OPNsense firewall. The existing NMS is Zabbix and already monitors switches and routers via SNMP. What is the right approach?

  2. Q2. SNMPv2c sends the community string in cleartext on every poll.

  3. Q3. Which of the following are limitations of SNMP that have driven the adoption of Prometheus for newer monitoring stacks? Select all that apply.

  4. Q4. The operator wants to poll the OPNsense PF state table count via SNMP. Which OID should be polled?

Passing score: 75%. Answers are checked in this browser.