Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions keep/providers/snmp_provider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SNMP Provider

Monitor network devices via the Simple Network Management Protocol (SNMP).

## Features

- **SNMP GET**: Query a single OID from a network device
- **SNMP WALK**: Walk an entire OID subtree
- **Pull Alerts**: Monitor interface status (IF-MIB) and host resources (HOST-RESOURCES-MIB)
- **Receive Traps**: Process incoming SNMP trap notifications

## Authentication

Supports SNMP v1, v2c, and v3:

| Field | Description |
|-------|-------------|
| host | Device IP or hostname |
| port | UDP port (default: 161) |
| community | Community string (v1/v2c) |
| version | 1, 2c, or 3 |

For SNMPv3:

| Field | Description |
|-------|-------------|
| security_name | Username |
| auth_protocol | MD5 or SHA |
| auth_key | Authentication passphrase |
| priv_protocol | DES, AES128, AES192, AES256 |
| priv_key | Privacy passphrase |

## Configuration



## Usage

### Query OIDs



### Walk a Subtree



## Common OIDs

| OID | Name | Description |
|-----|------|-------------|
| 1.3.6.1.2.1.1.1.0 | sysDescr | System description |
| 1.3.6.1.2.1.1.5.0 | sysName | System name |
| 1.3.6.1.2.1.2.2.1.8 | ifOperStatus | Interface operational status |
| 1.3.6.1.2.1.2.2.1.2 | ifDescr | Interface description |
| 1.3.6.1.2.1.2.2.1.5 | ifSpeed | Interface speed |
| 1.3.6.1.2.1.25.3.2.1.5 | hrDeviceStatus | Host resource device status |

## Triggers / Webhook

The SNMP provider can receive SNMP traps via the Keep webhook endpoint:



SNMP trap data is formatted into Keep alerts via .
7 changes: 7 additions & 0 deletions keep/providers/snmp_provider/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
SNMP Provider - Network device monitoring via SNMP protocol.
"""

from keep.providers.snmp_provider.snmp_provider import SnmpProvider

__all__ = ["SnmpProvider"]
33 changes: 33 additions & 0 deletions keep/providers/snmp_provider/alerts_mock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
SNMP Provider Alerts Mock - Used for testing purposes.
"""

SNMP_ALERT_GET_RESPONSE = {
"1.3.6.1.2.1.1.1.0": "Linux 4.19.0-18-amd64 #1 SMP Debian",
"1.3.6.1.2.1.1.5.0": "router01",
}

SNMP_ALERT_WALK_RESPONSE = {
"1.3.6.1.2.1.1.1.0": "Linux 4.19.0-18-amd64",
"1.3.6.1.2.1.1.3.0": "12345",
"1.3.6.1.2.1.1.5.0": "router01",
"1.3.6.1.2.1.1.6.0": "1",
}

SNMP_ALERT_INTERFACE_DOWN = {
"id": "192.168.1.1-if-2",
"name": "Interface Down: GigabitEthernet0/1",
"description": "Interface 2 (ethernetCsmacd) is down. Speed: 1000000000",
"severity": "critical",
"host": "192.168.1.1",
"status": "firing",
}

SNMP_ALERT_TRAP_V2C = {
"oid": "1.3.6.1.4.1.9.9.42.2.0.1",
"name": "Interface Status Change",
"description": "Link down on interface 2",
"severity": "critical",
"host": "10.0.0.1",
"SNMPv2-SMI::snmpTrapOID.0": "1.3.6.1.4.1.9.9.42.2.0.1",
}
Loading
Loading