Chapter 4: Testing Alerts Offline (snmp3 trap + syslog)

Send encrypted SNMPv3 authPriv traps and Syslog events to Zabbix, PRTG, or Splunk straight from numeric OIDs.

Labs completed0/7
The Situation · 6 min

Prove your NMS wakes up the on-call rotation when uplink Gi1/0/24 dies — without actually taking down Building 2.

What You'll Pull Off Here

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

Lab 4: Escalate Gi1/0/1 to Critical Uplink Gi1/0/24

Bump the syslog alert from severity 4 to critical severity 2 mentioning "Gi1/0/24", and update the snmp3 trap interface string 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.Hit Check Exercise to verify both alerts compile cleanly.

1. SNMPv3 Crypto Without MIB-Path Despair

Anyone who has ever fought snmptrap -v 3 -e 0x8000... while Net-SNMP screams about missing vendor MIB files knows true spiritual pain.

FrameAssembly encodes ASN.1 BER and full RFC 3414/7860 SHA-256 + AES-128 USM encryption straight from numeric OIDs. On snmp2 and snmp3 traps, linkDown is just a standard varbind pairing 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, followed by whatever interface varbinds you want.

  • Text varbinds spell out string "..." (never str "...").
  • snmp3 engineid takes an even-length hex string like "80001f888011223344".
  • trap, inform, and report auto-target UDP 162; get, getnext, getbulk, and set auto-target 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 .frasm — Labs, Guides & 81 Protocols | FrameAssembly