feat: Add SNMP Provider (traps v1/v2c/v3 + polling)#6399
Open
vasquezmyguy-collab wants to merge 2 commits intokeephq:mainfrom
Open
feat: Add SNMP Provider (traps v1/v2c/v3 + polling)#6399vasquezmyguy-collab wants to merge 2 commits intokeephq:mainfrom
vasquezmyguy-collab wants to merge 2 commits intokeephq:mainfrom
Conversation
keephq#2112) - Implement SnmpProvider with consumer pattern (start_consume/stop_consume) using pysnmp low-level NotificationReceiver in a daemon thread - Support SNMPv1/v2c (community string) and SNMPv3 (USM auth/priv) - Map SNMP trap varbinds to Keep AlertDto format (name, description, severity, status, source, labels) - Implement _query() for SNMP polling via hlapi async generators (getCmd, nextCmd, bulkCmd) - Add SnmpProviderAuthConfig with pydantic dataclass fields for host, port, snmp_version, community, v3 credentials, polling config - Include alerts_mock.py with representative v1/v2c/v3 trap examples - Follow Keep provider conventions (PROVIDER_CATEGORY, PROVIDER_TAGS, PROVIDER_SCOPES, FINGERPRINT_FIELDS, validate_config, validate_scopes, dispose, status, _format_alert)
Author
|
🎬 Demo Video: SNMP Provider in Action This video demonstrates the SNMP provider receiving traps and converting them to Keep alerts: What you'll see:
The provider uses pysnmp-lextudio v6 (CamelCase API) for both trap receiving (low-level |
Author
🎬 Demo VideoSNMP Provider in action — showing trap receiving and alert formatting: 📥 Download MP4 video (higher quality, 0.9 MB) What the demo shows:
Key implementation details:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

SNMP Provider — Traps (v1/v2c/v3) + OID Polling
Implements #2112 —
/claim #2112What's included
SnmpProviderclass following Keep'sBaseProviderpattern:start_consume()/stop_consume(), runs a pysnmpNotificationReceiverin a daemon thread, pushes incoming traps as alerts viaself._push_alert()_query()method supportinggetCmd,nextCmd, andbulkCmdoperations viapysnmp.hlapi.asynciogenerators_format_alert()static method for webhook/push path compatibilitySNMPv1 / v2c / v3 support:
CommunityDataSnmpProviderAuthConfig— pydantic dataclass withrequired,description,hint,sensitivemetadata for Keep UIWell-known trap mapping: automatically maps standard trap OIDs (coldStart, warmStart, linkDown, linkUp, authenticationFailure, egpNeighborLoss) to meaningful names and Keep severity levels
alerts_mock.py— representative mock alert data for v1/v2c/v3 traps and poll resultsProvider class attributes
PROVIDER_DISPLAY_NAMEPROVIDER_CATEGORY["Monitoring"]PROVIDER_TAGS["alert"]FINGERPRINT_FIELDS["name"]PROVIDER_SCOPEStrap_receive,snmp_pollpysnmp v6 API compliance
Uses the current CamelCase pysnmp API throughout:
SnmpEngine(),Config.addV1System(),Config.addV3User(),Config.addTransport()udp.domainName,transport.openServerMode()hlapi:getCmd,nextCmd,bulkCmd,CommunityData,UsmUserData,UdpTransportTarget,ContextDataCloses #2112
🎬 Demo Video
📥 Download MP4 video (higher quality)
The demo shows: