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
- Open
Settings
→System Settings
→SNMPTrapd
. - 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)
- 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
, andSNMPTRAPD_FORMAT
. - If the module does not start automatically after enabling, restart services.
Verify reception
- From a device or a test sender, deliver a trap to the LogZilla host on UDP
port
162
. - In LogZilla, search for traps using:
program:"SNMPTrap"
(or the configured program value), and/orfacility:LOCAL0
(or the configured facility), and/or- text from the configured
SNMPTRAPD_FORMAT
.
- 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