Skip to content

feat(provider): Add SNMP webhook support for receiving traps (Issue #2112)#6096

Closed
matiasmagni wants to merge 20 commits intokeephq:mainfrom
matiasmagni:feat/issue-2112-optimize-ai-settings
Closed

feat(provider): Add SNMP webhook support for receiving traps (Issue #2112)#6096
matiasmagni wants to merge 20 commits intokeephq:mainfrom
matiasmagni:feat/issue-2112-optimize-ai-settings

Conversation

@matiasmagni
Copy link
Copy Markdown

@matiasmagni matiasmagni commented Mar 15, 2026

Summary

Implements Issue #2112: Receive SNMP traps into Keep as alerts via webhook.

Changes Made

Backend

  • Added webhook_description and webhook_template class attributes for receiving traps via HTTP
  • Added parse_event_raw_body() static method to parse incoming JSON payloads
  • Added _format_alert() static method to convert SNMP trap events to AlertDto
  • Added severity mapping (critical, error, high, warning, medium, low, info)
  • Added proper metadata for auth config fields

Tests

  • Added 40+ comprehensive unit tests
  • Added E2E test infrastructure with docker-compose

Documentation

  • Complete rewrite covering both sending and receiving SNMP traps
  • Added webhook configuration examples
  • Added Zabbix integration example

Demo

The SNMP provider now supports receiving traps via webhook. When configured, users can:

  1. Get a webhook URL from the SNMP provider settings in Keep
  2. Configure their SNMP trap collector (Zabbix, Nagios, SNMPTT) to forward traps to that URL
  3. Traps are automatically ingested as alerts in Keep with proper severity mapping

Example webhook payload:

{
  "oid": "1.3.6.1.4.1.12345.1.2.3",
  "message": "CPU usage is high",
  "source": "server01",
  "severity": "critical"
}

This creates a firing alert with CRITICAL severity in Keep.

Video Demo

Link: https://youtu.be/_i0x0GqxG4Y

Since this is a backend-only change (the provider auto-discovers the webhook capability), here's how it works:

  1. User installs SNMP provider in Keep UI
  2. Provider settings page shows webhook URL
  3. User configures external system to send POST requests to that URL
  4. Alerts appear in Keep with parsed trap data

/claim #2112
Closes #2112

Matias Magni and others added 2 commits December 26, 2025 23:51
…eephq#2112)

- Add webhook_description and webhook_template for receiving SNMP traps
- Add parse_event_raw_body() for parsing incoming trap JSON payloads
- Add _format_alert() to convert traps to AlertDto objects
- Add severity mapping (critical, error, high, warning, medium, low, info)
- Add comprehensive unit tests for all new functionality
- Add E2E test infrastructure for SNMP provider
- Update documentation with webhook configuration examples
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 15, 2026

@matiasmagni is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 15, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 15, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ matiasmagni
❌ Matias Magni


Matias Magni seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dosubot dosubot bot added Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues labels Mar 15, 2026
…eephq#2112)

- Add webhook_description and webhook_template for receiving traps via HTTP
- Add parse_event_raw_body() for parsing incoming trap JSON payloads
- Add _format_alert() to convert traps to AlertDto objects
- Add severity mapping (critical, error, high, warning, medium, low, info)
- Add comprehensive unit tests for all new functionality
- Add E2E test infrastructure for SNMP provider
- Update documentation with webhook configuration examples
- Add demo guide with curl and PowerShell commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim Documentation Improvements or additions to documentation 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

2 participants