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