SNMP-Trap-Tools(at)WorkTwo tools for testing SNMP notifications.
SNMP Trap Sender simulates a network device and sends traps. SNMP Trap Receiver accepts traps, names the notifications from MIB files and shows them in the browser. Both run on Rocky Linux 9 and are installed from a single installer file, with no internet access needed.
| Time | Notification | OID | Variables |
|---|---|---|---|
| 10:33:24 | TRAPSIM-MIB::tsimReboot | 1.3.6.1.4.1.32473.1.1.0.2 | reason = operatorRequest, downtime = 5 s |
| 10:33:29 | SNMPv2-MIB::coldStart | 1.3.6.1.6.3.1.1.5.1 | sysUpTime = 0 |
| 10:33:29 | TRAPSIM-MIB::tsimDeviceUp | 1.3.6.1.4.1.32473.1.1.0.3 | tsimDeviceName = sw-lab-01 |
SNMP Trap Receiver
2.1.0Receives SNMP traps and informs from switches, routers, ESXi hosts and UPSs. Translates OIDs to names using MIB files, stores everything in log files and shows the notifications live in a web GUI in English or Norwegian.
- Receives
- SNMPv1 traps, v2c traps and informs, v3 traps and informs with noAuthNoPriv, authNoPriv and authPriv. UDP over IPv4 and IPv6.
- Translates
- Trap OIDs and variable names, using uploaded vendor MIBs and 25 built-in IETF MIBs. The MIBs are compiled offline.
- Stores
- A human-readable text log and a JSON Lines log, both with rotation.
- Shows
- A live list with filters, per-trap details, CSV export, receiver status, MIB management and log downloads.
SNMP Trap Sender
1.1.0Simulates a network device that sends notifications: heartbeat, reboot, interfaces going down and up, test messages and bursts for load testing. To one or more targets, in SNMP v1, v2c or v3.
- Simulates
- One device with a name, an agent address for SNMPv1, its own engine ID for SNMPv3 and a sysUpTime that restarts on reboot.
- Events
- Heartbeat, reboot, device up, interface down and up, test message, coldStart, warmStart, linkDown and linkUp.
- Scenarios
- Reboot with downtime, an interface going down and up, and a burst at a fixed rate. Can be cancelled along the way.
- Schedules
- Repeat an event at a given interval, for example a heartbeat every minute.
- TRAPSIM-MIB
- Its own MIB under enterprise 32473. Upload it to the receiver, and every simulated notification gets a name.
Used together
The sender is built as the counterpart of the receiver. A reboot scenario produces the same sequence as a real device, so you can test rules and alarms on the receiver side.
tsimRebootThe sender announces that the device is restarting, with the reason and the expected downtime.
- Silent during the downtime
Scheduled heartbeats pause. The receiver sees a gap in the heartbeat numbering.
coldStartsysUpTime and the heartbeat number start from 0 again.
tsimDeviceUpThe device reports that it is up, with the reason and the actual downtime.
Installation
Each application ships as a self-contained installer with everything it needs. It verifies checksums, installs a hardened systemd service and runs a self-test at the end.
Receiver
$ sha256sum -c snmp-trap-receiver-offline-installer.run.sha256
$ sudo bash snmp-trap-receiver-offline-installer.run
# open http://<server>:8080/
Requires Rocky Linux 9, minimal installation included, with Python 3.9. Opens UDP 162 and TCP 8080 in firewalld.
Sender
$ sha256sum -c snmp-trap-sender-offline-installer.run.sha256
$ sudo bash snmp-trap-sender-offline-installer.run \
--target <receiver-ip> --heartbeat 60
# upload TRAPSIM-MIB.mib to the receiver
Runs in a VM or a Proxmox LXC container. Without nesting in the container, the installer turns off the extra sandbox by itself.
Screenshots
Both user interfaces are available in English and Norwegian and also work on mobile. Pictures marked “Norwegian UI” show the Norwegian version of the same screen. Click to see a picture in full size.