Skip to content

feat: add Nagios provider for host/service alert monitoring#6143

Closed
chengyixu wants to merge 3 commits intokeephq:mainfrom
chengyixu:feat/nagios-provider
Closed

feat: add Nagios provider for host/service alert monitoring#6143
chengyixu wants to merge 3 commits intokeephq:mainfrom
chengyixu:feat/nagios-provider

Conversation

@chengyixu
Copy link
Copy Markdown

@chengyixu chengyixu commented Mar 28, 2026

Summary

Adds a new `NagiosProvider` that integrates Keep with Nagios monitoring systems.

  • Supports Nagios XI (commercial) via REST API (`/nagiosxi/api/v1/objects/hoststatus` and `servicestatus`) using API key authentication
  • Supports Nagios Core (open source) via CGI JSON API (`statusjson.cgi`) using HTTP basic auth
  • Supports webhook push notifications via custom Nagios notification commands (full setup guide in `webhook_markdown`)
  • Maps Nagios host states (UP/DOWN/UNREACHABLE) and service states (OK/WARNING/CRITICAL/UNKNOWN) to Keep `AlertStatus` and `AlertSeverity`
  • Both `_get_alerts()` (pull) and `_format_alert()` (push) are implemented
  • Includes `README.md` with setup instructions for both Nagios XI and Core
  • Includes `alerts_mock.py` with sample webhook payload
  • Includes `tests/providers/nagios_provider/` with 20 unit tests covering all state mappings and edge cases

Files Changed

  • `keep/providers/nagios_provider/init.py` (empty, required)
  • `keep/providers/nagios_provider/nagios_provider.py` (provider implementation)
  • `keep/providers/nagios_provider/README.md` (setup guide)
  • `keep/providers/nagios_provider/alerts_mock.py` (sample webhook payload)
  • `tests/providers/nagios_provider/test_nagios_provider.py` (20 unit tests)

Test plan

  • `_format_alert()` correctly handles HOST + SERVICE webhook payloads
  • All Nagios states (DOWN/UNREACHABLE/UP for hosts; CRITICAL/WARNING/UNKNOWN/OK for services) map correctly to Keep `AlertStatus` and `AlertSeverity`
  • Alert IDs generated deterministically from hostname/service name
  • Missing optional fields do not raise exceptions
  • Class name `NagiosProvider` matches Keep's provider factory convention
  • Both Nagios XI (API key) and Nagios Core (basic auth) code paths implemented
  • README documents webhook setup for both Nagios XI and Nagios Core

Closes #3960

/claim #3960

🤖 Generated with Claude Code

Adds a new Nagios provider that integrates with both Nagios XI (REST API)
and Nagios Core (CGI JSON API) to pull host and service alerts into Keep.

Also supports webhook-based push notifications via custom Nagios notification
commands documented in the provider's webhook_markdown.

Closes keephq#3960
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

@chengyixu 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 28, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot bot added Feature A new feature Provider Providers related issues labels Mar 28, 2026
Add README with authentication guide for both Nagios XI and Core,
and alerts_mock.py with a sample webhook payload for testing.
Covers _format_alert() for HOST and SERVICE webhook payloads, all
Nagios state→severity/status mappings, and graceful handling of
missing optional fields.
@shahargl
Copy link
Copy Markdown
Member

Closing: bulk spam PRs.

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

Labels

🙋 Bounty claim Feature A new feature 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