Skip to content

feat: add SNMP provider for network device monitoring#6232

Open
Ojas2095 wants to merge 2 commits intokeephq:mainfrom
Ojas2095:snmp-provider-implementation
Open

feat: add SNMP provider for network device monitoring#6232
Ojas2095 wants to merge 2 commits intokeephq:mainfrom
Ojas2095:snmp-provider-implementation

Conversation

@Ojas2095
Copy link
Copy Markdown

@Ojas2095 Ojas2095 commented Apr 9, 2026

Description

Adds a new SNMP provider that enables Keep to query networking devices via SNMP protocol.

Features

  • SNMP GET: Query individual OIDs on network devices
    • SNMP WALK: Walk OID subtrees for bulk data collection
    • SNMPv1/v2c support via pysnmp-lextudio library
    • Standard BaseProvider integration with _query() method
    • Configurable host, port, community string, and SNMP version

Changes


Note

Medium Risk
Introduces a new provider that performs outbound SNMP network calls and adds a new runtime dependency (pysnmp-lextudio), which could impact deployments and error-handling behavior at runtime.

Overview
Adds a new SnmpProvider that integrates with BaseProvider to query SNMP devices via _query() using SNMP get and walk, with configurable host, port, community, and version (v1/v2c).

Updates dependencies to include pysnmp-lextudio to support the SNMP HLAPI used by the provider.

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

Implements a new SNMP provider that enables Keep to query network devices via SNMP GET and WALK operations. Uses pysnmp-lextudio for robust SNMPv1/v2c protocol support.

Resolves keephq#2112
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 9, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot bot added Dependencies Pull requests that update a dependency file Feature A new feature Provider Providers related issues labels Apr 9, 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 7ec59da. Configure here.

severity=AlertSeverity.INFO,
source=["snmp"],
**event
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

_format_alert crashes from duplicate keyword arguments

High Severity

_format_alert passes explicit keyword arguments like id, name, status, severity, and source alongside **event. When event contains any of those same keys — which is the anticipated case given the event.get("id", ...) pattern — Python raises a TypeError for duplicate keyword arguments before AlertDto ever processes them. Other providers (e.g., Kibana) avoid this by using event.pop() to remove keys from the dict before **event unpacking.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ec59da. Configure here.

- Added explicit SNMP version validation (ValueError for unsupported versions instead of silent fallback) - Fixed _format_alert to exclude known fields before spreading event dict, preventing duplicate keyword TypeError - Improved logging to use lazy string formatting
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 9, 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

Dependencies Pull requests that update a dependency file 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