I need some help with Trap Handlers and if you require more information please ask me

My Trap Handler is not working is it because my code trap handler is wrong or maybe the snmptrapd is wrong, Im guessing the traps are not going through the trap handlers because i crossed checked with coldboot.php it seems to be correct.

SNMP Trap Handler Code:

SNMP Raw Trap on Eventlog on WebUI of the device:
SNMPv2-SMI::enterprises.54505.2.3 {“SNMPv2-MIB::sysUpTime.0”:“0:1:11:49.76”,“SNMPv2-MIB::sysName.0”:“Test_device”,“SNMPv2-SMI::enterprises.54505.1.1”:“-10.39”}

Desired Output:
TCT: Laser link up. Rx Power: -10.39

I also checked mysql server i found out that nothing is my snmptraps are getting logged at the eventlog table but in raw data and when i looked at it i can see the handled cold start on the eventlogs of the web UI but i cannot see my own handled traps

Have you followed SNMP Traps - LibreNMS Docs

Also, you need to register it in config/snmptraps.php

Yes expect i can’t do this step: Make sure the MIB is loaded from the trap you are adding. Edit /etc/systemd/system/snmptrapd.service.d/mibs.conf to add it then restart snmptrapd.

as i could not find it and i already registered into config/snmptraps.php but do i need to restart it? If so I could i do it?

Try this SNMP Trap Handler - LibreNMS Docs

Restart snmptrapd to be sure any changes are picked up

Am i Supposed to create a file here: Create a folder for storing traps for example in file traps.log

sudo mkdir /var/log/snmptrap

called trap.log?

and is the snmptrapd supposed to be like this?

or do i need to include all MIBs?

When i tried this step: snmptrap -v 2c -c public localhost ‘’ 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456 no snmptrapd is shown on the log

Is snmptrapd actually running? Have you checked any log files?

Yep i checked the systemctl status it said it is running and been collecting raw traps and displaying it on the WebUI but what i want is displaying handled traps


/opt/librenms/config/snmptrapd.php

/opt/librenms/config.php

Am i like missing out on somethings? To add on im using the virtualbox VM provided on doc

@laf is there any solutions to this problem?

I don’t use traps so I don’t really have any other suggestions

@murrant Any ideas or suggestion on how it can be fixed?

Doesn’t the -m in your snmptrapd service config need to have a value of ‘all’, or a list of all modules to load? In your picture above its just loading IF-MIB.

i don’t know i just follow the trap handler documentations

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.