Skip to content

feat(providers): add Nagios monitoring provider#5789

Closed
junyuc25 wants to merge 1 commit intokeephq:mainfrom
junyuc25:feat/nagios-provider
Closed

feat(providers): add Nagios monitoring provider#5789
junyuc25 wants to merge 1 commit intokeephq:mainfrom
junyuc25:feat/nagios-provider

Conversation

@junyuc25
Copy link

@junyuc25 junyuc25 commented Mar 6, 2026

Summary

Adds a Nagios monitoring provider to Keep.

  • Push/webhook mode (Nagios Core + XI): Nagios notification commands send JSON payloads via curl to Keep's webhook endpoint. Works out-of-the-box for any Nagios installation.
  • Pull mode (Nagios XI only): Fetches all non-OK service and host statuses from the Nagios XI REST API on demand.

Changes

  • keep/providers/nagios_provider/nagios_provider.py — Full provider implementation
    • NagiosProviderAuthConfig with nagios_url, api_key, verify fields
    • _format_alert as @staticmethod handling service + host webhook payloads
    • _get_alerts pulling from Nagios XI /api/v1/objects/servicestatus and /hoststatus
    • validate_scopes verifying XI API connectivity
    • Class-level SEVERITY_MAP, STATUS_MAP, NOTIFICATION_TYPE_TO_STATUS dicts
  • keep/providers/nagios_provider/ALERTS_MOCK.py — 8 sample payloads (service/host, all states, RECOVERY, ACKNOWLEDGEMENT)
  • keep/providers/nagios_provider/README.md — Setup guide for webhook and pull modes, Docker-based local testing
  • tests/test_nagios_provider.py — 15 unit tests (all passing)

Test plan

  • _format_alert handles service CRITICAL, WARNING, UNKNOWN, and RECOVERY payloads
  • _format_alert handles host DOWN, UNREACHABLE, and RECOVERY payloads
  • _format_alert maps ACKNOWLEDGEMENT notification type correctly
  • Severity and status maps cover all Nagios states
  • Numeric state maps used for pull mode are complete
  • Deterministic alert IDs are consistent across calls
  • All 15 unit tests pass

Closes #3960

Adds NagiosProvider supporting both push (webhook) and pull (Nagios XI REST API) modes:
- Webhook push mode works with Nagios Core and Nagios XI via curl notification commands
- Pull mode fetches non-OK service/host statuses from Nagios XI REST API
- Includes ALERTS_MOCK.py, README with local testing instructions, and 15 unit tests

Closes keephq#3960
@vercel
Copy link

vercel bot commented Mar 6, 2026

Someone 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:XL This PR changes 500-999 lines, ignoring generated files. label Mar 6, 2026
@CLAassistant
Copy link

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.


junyuc25 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 the Provider Providers related issues label Mar 6, 2026
@junyuc25
Copy link
Author

junyuc25 commented Mar 8, 2026

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.

junyuc25 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.

I believed I already signed the CLA

@shahargl shahargl closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Provider Providers related issues size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: Nagios Provider

3 participants