feat: add PRTG Network Monitor provider#6521
Open
rothdren-lion wants to merge 3 commits into
Open
Conversation
|
|
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new PRTG Network Monitor provider to Keep, as requested in #2282.
What does this PR do?
PrtgProviderthat receives alerts from PRTG via HTTP Action (webhook) notificationswebhook_markdownPRTG 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
_format_alertwith sample PRTG alert data:Closes #2282