Skip to content

feat: Add SNMP provider for receiving SNMP traps as alerts#6258

Open
ska2704 wants to merge 2 commits intokeephq:mainfrom
ska2704:feature/snmp-provider
Open

feat: Add SNMP provider for receiving SNMP traps as alerts#6258
ska2704 wants to merge 2 commits intokeephq:mainfrom
ska2704:feature/snmp-provider

Conversation

@ska2704
Copy link
Copy Markdown

@ska2704 ska2704 commented Apr 16, 2026

Closes #2112

Description

Adds SNMP provider that receives SNMP v1/v2c traps as Keep alerts.

  • keep/providers/snmp_provider/snmp_provider.py, provider with _format_alert(), severity mapping for all 6 generic trap types (coldStart, warmStart, linkDown, linkUp, authenticationFailure, egpNeighborLoss), SHA-256 fingerprinting for deduplication
  • keep/providers/snmp_provider/alerts_mock.py - 6 realistic mock trap scenarios
  • keep/providers/snmp_provider/__init__.py

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information

SNMP is push-only network devices send traps to Keep's webhook endpoint, no credentials needed. The provider follows the same pattern as NetdataProvider (no auth config, pure _format_alert ingest).

/claim #2112


Note

Low Risk
Adds a new provider and mock data without changing existing provider logic or shared infrastructure; primary risk is payload-format mismatches causing incorrect alert fields/severity.

Overview
Introduces a new SnmpProvider that accepts push-based SNMP trap webhook payloads and maps them into Keep AlertDtos, including generic-trap name/severity mapping, label extraction (community/agent/OID/varbinds), timestamp handling, and SHA-256 fingerprinting for deduplication.

Adds alerts_mock.py with several realistic SNMP trap examples to support BaseProvider.simulate_alert() for local testing/simulation (with an empty __init__.py scaffold for the new provider package).

Reviewed by Cursor Bugbot for commit f1b29c5. Bugbot is set up for automated code reviews on this repo. Configure here.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 16, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 16, 2026

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot Bot added Feature A new feature Provider Providers related issues labels Apr 16, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f1b29c5. Configure here.

Comment thread keep/providers/snmp_provider/snmp_provider.py Outdated
Comment thread keep/providers/snmp_provider/snmp_provider.py
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 16, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim Feature A new feature Provider Providers related issues size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: SNMP provider

2 participants