Receiving Snmp Traps

LogZilla documentation for Receiving Snmp Traps

Receiving SNMP Traps

LogZilla can receive SNMP traps via the built‑in SNMP trap daemon. The module can be enabled and configured in the web interface.

Enable in the UI

  1. Open SettingsSystem SettingsSNMPTrapd.
  2. Set the following fields as required:
    • SNMPTrapd Enabled → On
    • SNMPTrapd Port → 162 (UDP)
    • SNMPTrapd Severity → default INFO
    • SNMPTrapd Facility → default LOCAL0
    • SNMPTrapd Program → default SNMPTrap
    • SNMPTrapd Format → default format compatible with snmptrapd(8)
  3. Click Save changes.

Notes:

  • Defaults and field meanings are defined by the SNMPTrapd settings model: SNMPTRAPD_ENABLED, SNMPTRAPD_PORT, SNMPTRAPD_SEVERITY, SNMPTRAPD_FACILITY, SNMPTRAPD_PROGRAM, and SNMPTRAPD_FORMAT.
  • If the module does not start automatically after enabling, restart services.

Verify reception

  1. From a device or a test sender, deliver a trap to the LogZilla host on UDP port 162.
  2. In LogZilla, search for traps using:
    • program:"SNMPTrap" (or the configured program value), and/or
    • facility:LOCAL0 (or the configured facility), and/or
    • text from the configured SNMPTRAPD_FORMAT.
  3. For packet‑level checks, use the procedures in Syslog Troubleshooting.

Optional CLI Configuration

The logzilla settings command can be used to configure the SNMP trap daemon from the command line.

bash
# Enable and set the UDP port
logzilla settings update SNMPTRAPD_ENABLED=true SNMPTRAPD_PORT=162

# Set event fields
logzilla settings update \
  SNMPTRAPD_SEVERITY=INFO \
  SNMPTRAPD_FACILITY=LOCAL0 \
  SNMPTRAPD_PROGRAM=SNMPTrap

# Set a custom snmptrapd(8) message format when needed
logzilla settings update \
  SNMPTRAPD_FORMAT='Enterprise OID: %N, Trap Type: %W, Trap Sub-Type: %q, Uptime: %T, Description: %W, PDU Attribute/Value Pair Array: %v'

# Apply if a restart is required
logzilla restart

Related topics

Receiving Snmp Traps | LogZilla Documentation