New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNMP trap or notification handling #117143
Comments
Hey there @nmaggioni, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) snmp documentation |
That's correct, the current SNMP integration only offers polling/scraping capabilities. If you need to receive traps two alternatives come to my mind:
By taking a (very) quick look at other Local Push integrations I'd say that if one were to develop a SNMP trap listener it could be useful to look at how, for example, the Wiffi component [3] [4] sets things up and then rely on the existing pysnmp dependency for receiving and parsing traps (here's an example but watch out, it's using old and unsupported code; I couldn't find the same functionalities in pysnmp's new If you already have a Node-RED instance running or you're willing to set it up, I'd vote for that solution. That way you can also leverage more complex handling logics in case you need to trigger something or do multiple checks when a trap is received (ex.: NAS goes on UPS and sends trap, you poll the UPS itself to get accurate runtime stats, schedule a check a few mins later, eventually shut down the NAS through SSH and, when it stops replying to ICMP pings, turn off the plug it's connected to). How does that sound? |
Thanks for the detailed reply. I did try to avoid Node-RED until now, as I did not want to add another point of failure. But I might will go down to that route. And I generally though that the documentation must have not been updated, as the integration was added to HA years ago... Unfortunately the need arose recently to monitor the aforementioned NAS, as it produced a drive failure message without any logged event, just the LED came on, and the software was telling that there is a drive failure. The drive and the NAS has passed all tests, but it was still thinking the drive has a failure, which I couldn't track down what was the reason for. Magically, a restart cleared the drive failure, but I need to monitor the device to find out what could have been the issue... |
The problem
There seems to be a missing basic functionality of SNMP integration or it is not documented at all. I cannot figure out how to define a sensor for incoming SNMP notification from a WD EX2 Ultra device. The documentation refers to polling only but there is not mention of receiving SNMP messages.
What version of Home Assistant Core has the issue?
core-2024.5.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
SNMP
Link to integration documentation on our website
https://www.home-assistant.io/integrations/snmp#sensor
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
The text was updated successfully, but these errors were encountered: