feat(providers): Add SNMP provider for receiving SNMP traps as alerts#5631
Open
thebrierfox wants to merge 1 commit intokeephq:mainfrom
Open
feat(providers): Add SNMP provider for receiving SNMP traps as alerts#5631thebrierfox wants to merge 1 commit intokeephq:mainfrom
thebrierfox wants to merge 1 commit intokeephq:mainfrom
Conversation
Implements SNMP trap ingestion via webhook. snmptrapd forwards traps as JSON to Keep's event endpoint, which are converted to AlertDto. - SNMPv1/v2c/v3 trap parsing with well-known OID resolution - Automatic severity mapping (linkDown=CRITICAL, coldStart=INFO, etc.) - Status detection (linkUp=RESOLVED, others=FIRING) - SHA256 fingerprinting for deduplication (source_ip + trap_oid) - Varbind extraction into alert labels - 20 unit tests covering all code paths - Full documentation with snmptrapd setup guide Closes keephq#2112 Co-Authored-By: thebrierfox <thebrierfox@users.noreply.github.com>
|
@thebrierfox is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Contributor
|
Target branch is not in the allowed branches list. |
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.
Summary
Implements an SNMP provider that receives SNMP traps via webhook and converts them into Keep alerts.
How it works: An external
snmptrapddaemon receives SNMP traps and forwards them as JSON payloads to Keep's/event/snmpendpoint via a simple shell script or HTTP forwarder.Key features:
source_ip + trap_oidensures duplicate traps are deduplicatedFiles changed:
keep/providers/snmp_provider/__init__.pykeep/providers/snmp_provider/snmp_provider.pytests/test_snmp_provider.pydocs/providers/documentation/snmp-provider.mdxkeep-ui/public/icons/snmp-icon.pngArchitecture:
Test coverage:
TestParseEventRawBody— dict passthrough, JSON bytes, invalid JSON, other typesTestGetTrapName— well-known OIDs, SNMPv1 generic_trap, enterprise-specific, unknownTestGetSeverity— all severity levels, event-provided severity overrideTestGetStatus— linkUp=RESOLVED, linkDown=FIRING, unknown=FIRINGTestBuildFingerprint— deterministic, different inputs = different fingerprintsTestFormatAlert— v2c linkDown, v1 coldStart, linkUp resolved, enterprise traps, varbinds, minimal events/claim #2112
Closes #2112