Creating of SNMP trap handlers

I have a (hopefully) simple question. I’ve read through the page here at least dozen times and cannot make sense of where I need to create the .php files for the handlers: https://docs.librenms.org/Developing/SNMP-Traps/

I have the traps working with snmptrapd, I have the MIBs loaded, and the traps are appearing in the event log. I just don’t get how to add the proper handlers. Can someone point me in the right direction please for where the .php files need to go?

I haven’t written a handler yet, but I would put the .php file in
LibreNMS\Snmptrap\Handlers

(… as it says on the doc page You cited in the 4th paragraph …)

1 Like

@hfpbtrs

Those directories don’t exist though. Am I supposed to create them? And is that a LibreNMS directory inside the existing librenms directory? There is a case difference there.

@danodemano
The path on my installation is
/opt/librenms/LibreNMS/Snmptrap/Handlers
and it is a standard manual install as described by the documentation. The case difference is due to the namespaces in Lavarel. Please check with Laravel Documentation

1 Like

Ok, I’m just a dumbass. I swear that LibreNMS directory wasn’t there yesterday when I ran an ls on /opt/librenms

Thanks for the help, I’ll crawl back into my corner now.