Skip to content

feat: add PRTG Network Monitor provider#6521

Open
rothdren-lion wants to merge 3 commits into
keephq:mainfrom
rothdren-lion:prtg-provider
Open

feat: add PRTG Network Monitor provider#6521
rothdren-lion wants to merge 3 commits into
keephq:mainfrom
rothdren-lion:prtg-provider

Conversation

@rothdren-lion
Copy link
Copy Markdown

Summary

Adds a new PRTG Network Monitor provider to Keep, as requested in #2282.

What does this PR do?

  • Implements PrtgProvider that receives alerts from PRTG via HTTP Action (webhook) notifications
  • Maps PRTG status (Up/Down/Warning/Paused/Unknown) to Keep alert status (RESOLVED/FIRING/SUPPRESSED)
  • Maps PRTG priority (1-5) to Keep alert severity (INFO/WARNING/HIGH/CRITICAL)
  • Provides step-by-step webhook setup instructions in webhook_markdown
  • Stores PRTG-specific fields (sensor, device, group, probe, sensor_type, tags, priority) as extra attributes on AlertDto

PRTG Webhook Payload

The provider expects the following JSON payload from PRTG HTTP Action notifications (using PRTG %% placeholders):

{
  "host": "%%host",
  "name": "%%name",
  "sensor": "%%sensor",
  "message": "%%message",
  "status": "%%status",
  "lastvalue": "%%lastvalue",
  "device": "%%device",
  "group": "%%group",
  "probe": "%%probe",
  "link": "%%link",
  "id": "%%id",
  "sensorid": "%%sensorid",
  "datetime": "%%datetime",
  "down": "%%down",
  "sensor_type": "%%sensor_type",
  "tags": "%%tags",
  "priority": "%%priority"
}

Testing

  • Verified _format_alert with sample PRTG alert data:
    • Down + priority 5 → CRITICAL + FIRING ✓
    • Up + priority 1 → INFO + RESOLVED ✓
    • Warning + priority 2 → WARNING + FIRING ✓

Closes #2282

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. Feature A new feature Provider Providers related issues labels May 22, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

- Add FINGERPRINT_FIELDS = ['id'] for alert deduplication
- Fix validate_config: guard against None authentication
- Fix url field: sanitize PRTG %%placeholder values (prevents ValidationError)
- Fix sensor_id fallback: use 'is not None' check for sensorid='0' edge case
- Add alerts_mock.py for UI Alert Example feature
11 test cases covering:
- Full event, minimal event, empty event
- Status mapping (Up/Down/Warning/Paused/Unknown)
- Severity from priority (1-5) and fallback to status
- Unresolved %%placeholder sanitization
- sensorid precedence and zero edge case
- Numeric priority, host-as-device fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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]: prtg provider

2 participants