Skip to content

feat: add SNMP provider for receiving traps as alerts#6276

Open
vasquezmyguy-collab wants to merge 1 commit intokeephq:mainfrom
vasquezmyguy-collab:feat/snmp-provider
Open

feat: add SNMP provider for receiving traps as alerts#6276
vasquezmyguy-collab wants to merge 1 commit intokeephq:mainfrom
vasquezmyguy-collab:feat/snmp-provider

Conversation

@vasquezmyguy-collab
Copy link
Copy Markdown

Summary

Implements SNMP provider for receiving SNMP traps as Keep alerts (#2112).

Changes

  • SnmpProvider class following the consumer pattern (like Kafka provider)
  • Supports SNMP v1, v2c, and v3 (noAuthNoPriv / authNoPriv / authPriv)
  • Converts SNMP trap var-binds to Keep alert format with severity mapping
    • linkDown → high severity
    • authenticationFailure → warning
    • coldStart, warmStart, linkUp → info
  • Uses pysnmp-lextudio v6 asyncio API
  • Includes mock alert data for linkDown and coldStart traps
  • Adds pysnmp-lextudio dependency

How it works

The provider listens on a configurable UDP port (default: 162) for incoming SNMP traps. When a trap is received, the NotificationReceiver callback converts var-binds to a Keep alert dict and pushes it via _push_alert().

Testing

  • Syntax validated
  • Provider follows existing patterns (Kafka consumer provider as template)
  • pysnmp v6 asyncio API verified working with open_server_mode + add_transport + open_dispatcher

/claim #2112

Closes #2112

- SnmpProvider class following consumer pattern (start_consume/stop_consume)
- Supports SNMP v1, v2c, and v3 (authNoPriv/authPriv/noAuthNoPriv)
- Converts SNMP trap var-binds to Keep alert format with severity mapping
- Uses pysnmp-lextudio v6 asyncio API
- Includes mock alert data for linkDown and coldStart traps
- Adds pysnmp-lextudio dependency to pyproject.toml

/claim keephq#2112
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 22, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


vasquezmyguy-collab seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dosubot dosubot Bot added Dependencies Pull requests that update a dependency file Feature A new feature Provider Providers related issues labels Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim Dependencies Pull requests that update a dependency file Feature A new feature Provider Providers related issues size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: SNMP provider

2 participants