Skip to content

feat(checkmk): add REST API pull integration with authentication support#6262

Open
haoyousun60-create wants to merge 1 commit intokeephq:mainfrom
haoyousun60-create:feature/checkmk-enhancement
Open

feat(checkmk): add REST API pull integration with authentication support#6262
haoyousun60-create wants to merge 1 commit intokeephq:mainfrom
haoyousun60-create:feature/checkmk-enhancement

Conversation

@haoyousun60-create
Copy link
Copy Markdown

Summary

Enhanced the Checkmk provider with full REST API pull support. Previously the provider only supported webhook-based (push) integration. This PR adds the ability to actively pull alerts from Checkmk's REST API.

Changes

New Authentication Config

  • Added with fields:
      • Checkmk site URL
      • Automation user for API access
      • Automation secret/token
      • SSL verification toggle

New Provider Scopes

    • Read hosts from Checkmk API
    • Read services from Checkmk API
    • Read events from Checkmk API

New Methods

    • Main entry point, fetches all services with non-OK states and converts to alerts
    • Builds auth headers for Checkmk API
    • Fetches all hosts from Checkmk
    • Fetches services, optionally filtered by host

State Mapping

Maps Checkmk service states to Keep alert severities:

  • State 0 (OK) → INFO (not included as alert)
  • State 1 (WARN) → WARNING
  • State 2 (CRIT) → CRITICAL
  • State 3 (UNKNOWN) → INFO

Testing

Tested locally against Checkmk 2.2+ REST API endpoints.

- Added CheckmkProviderAuthConfig with URL, username, auth token support
- Added PROVIDER_SCOPES for read_hosts, read_services, read_events
- Added pull_alerts() method to fetch hosts/services via Checkmk REST API
- Added _get_headers(), _get_all_hosts(), _get_all_services() helper methods
- Added validate_config() with proper credential checks
- Maps Checkmk service states (0=OK, 1=WARN, 2=CRIT, 3=UNKNOWN) to AlertSeverity
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 19, 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.

@github-actions
Copy link
Copy Markdown
Contributor

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

@dosubot dosubot bot added API API related issues Enhancement New feature or request Provider Providers related issues labels Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API API related issues Enhancement New feature or request 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.

2 participants