Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add SNMP provider #3113

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

onyedikachi-david
Copy link

Closes #2112
/claim #2112

📑 Description

Add SNMP provider implementation for receiving SNMP traps and performing SNMP queries. This provider enables Keep to:

  • Receive and process SNMP traps from network devices
  • Convert SNMP traps to Keep alerts with proper severity mapping
  • Perform SNMP GET, GETNEXT, and GETBULK operations
  • Support SNMPv1, v2c, and v3 protocols with appropriate authentication

Changes completed:

  • Add SnmpProvider class with SNMPv1, v2c, and v3 support
  • Implement configuration validation for SNMP authentication
  • Add trap receiver with MIB compiler support
  • Add support for SNMP query operations (GET, GETNEXT, GETBULK)
  • Create comprehensive test suite
  • Update dependencies (pysnmp, pysmi)

✅ 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

Dependencies Added

  • pysnmp (7.1.16)
  • pysmi (1.5.9)

Breaking Changes

None

Configuration Example

authentication:
  snmp_version: "v2c"          # Options: v1, v2c, v3
  community_string: "public"
  listen_port: 162

  # SNMPv3 specific (optional)
  username: ""
  auth_protocol: "SHA"         # Options: MD5, SHA
  auth_key: ""
  priv_protocol: "AES"         # Options: DES, AES
  priv_key: ""

  mib_dirs: []                 # Optional: List of directories containing custom MIB files

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jan 24, 2025
@dosubot dosubot bot added Feature A new feature Provider Providers related issues labels Jan 24, 2025
Copy link

vercel bot commented Jan 24, 2025

@onyedikachi-david is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@shahargl
Copy link
Member

shahargl commented Feb 7, 2025

hey @onyedikachi-david - I'm not sure how this works. how does Keep server listens for the SNMP traps? you didn't add a server

@shahargl shahargl self-requested a review February 7, 2025 08:44
Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

server should be optional (default false) and not within the provider

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:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: SNMP provider
3 participants