Interactive Tutorial · Local Browser WebAssembly · 6 min

Chapter 4: SNMP Trap Simulation & Syslog Alerts (snmp2, snmp3 & syslog)

Simulate SNMPv2c and encrypted SNMPv3 authPriv traps plus Syslog alerts to verify Zabbix, PRTG, LibreNMS, or Splunk alerting without pulling live cables.

Labs completed0/7
The Situation · 6 min

Verify your NMS pages the on-call engineer when building uplink Gi1/0/24 goes down—without unplugging the fiber feeding Building 2.

What You'll Pull Off Here

  • Emit RFC 5424 syslog alerts on UDP 514 with facility, severity, hostname, app, and msg.
  • Simulate MIB-free snmp2 trap and encrypted snmp3 trap (sha256 + aes) packets on UDP 162.
  • Attach numeric OID varbind pairs (oidval, string, int, timeticks) cleanly.
Interactive Lab Check

Lab 4: Simulate a Critical Gi1/0/24 Uplink SNMPv3 Trap & Syslog Alert

Escalate the syslog alert from severity 4 to critical severity 2 mentioning "Gi1/0/24", and update the snmp3 trap interface varbind from "Gi1/0/1" to "Gi1/0/24".

  1. 1.On the syslog line, change severity 4 to severity 2 and mention Gi1/0/24 inside msg "...".
  2. 2.On the snmp3 trap line, change string "Gi1/0/1" to string "Gi1/0/24".
  3. 3.Click Check Exercise to verify both alerts compile cleanly.

1. Simulating SNMPv2c & Encrypted SNMPv3 Traps Without MIB Files

Testing SNMPv3 traps with CLI tools like snmptrap often turns into a fight over missing vendor MIB paths, engine IDs, and key-localization flags.

FrameAssembly builds standard UDP 162 trap packets and runs full SHA-256 HMAC authentication + AES-128 encryption directly from numeric OIDs. For a linkDown trap, pair 1.3.6.1.6.3.1.1.4.1.0 (snmpTrapOID.0) with oidval 1.3.6.1.6.3.1.1.5.3, then add interface varbinds like ifDescr.

  • String varbinds use the full word string "..." (never str "...").
  • snmp3 engineid expects an even-length hex string such as "80001f888011223344".
  • trap, inform, and report default to UDP 162; get, getnext, getbulk, and set default to UDP 161.
Word-by-Word Syntax Breakdown
Anatomy of an SNMP trap carrying two numeric varbinds:
access_sw -> nms_srv snmp2 trap community "noc-alerts" sysuptime 125000 varbind 1.3.6.1.6.3.1.1.4.1.0 oidval 1.3.6.1.6.3.1.1.5.3 varbind 1.3.6.1.2.1.2.2.1.2.24 string "Gi1/0/24"
snmp2 trapPDU TypeSNMPv2c Trapv2-PDU routed automatically to UDP 162
community "noc-alerts"AuthCommunity string (or user + auth + priv on snmp3)
varbind 1.3.6.1.6.3.1.1.4.1.0 oidval 1.3.6.1.6.3.1.1.5.3Trap OIDSets snmpTrapOID.0 to standard linkDown
varbind 1.3.6.1.2.1.2.2.1.2.24 string "Gi1/0/24"Payload VarbindSets ifDescr.24 to "Gi1/0/24"
Quick Formatting Reference (2 rules)
ItemValid .frasmAvoid
Varbind string keywordvarbind 1.3.6.1.2.1.1.5.0 string "sw-floor2"varbind 1.3.6.1.2.1.1.5.0 str "sw-floor2"
Setting Trap OIDsnmp2 trap varbind 1.3.6.1.6.3.1.1.4.1.0 oidval 1.3.6.1.6.3.1.1.5.3snmp2 trap trapoid 1.3.6.1.6.3.1.1.5.3
switch_uplink_alert.frasmLoading WASM…
Wireshark filter: syslog || snmp
Open in Playground
0 B · 0.000 ms
Compiling capture in WebAssembly…
Learn FrameAssembly: Docs, Protocols & Labs — FrameAssembly