This file provides guidance to AI agents when working with code in this repository.
Checkmk follows a modular architecture with several key components:
- cmk/base/: Core monitoring engine, configuration handling, and host management
- cmk/gui/: Web interface and user interaction components
- cmk/checkengine/: Check execution framework and result processing
- cmk/fetchers/: Data fetching mechanisms (SNMP, agent, piggyback, etc.)
- cmk/plugins/: Monitoring plugins and check implementations
- cmk/utils/: Shared utilities and helper functions
- cmk/piggyback/: Piggyback data handling for host relationships
- cmk/rrd/: RRD database interactions for metrics storage
- cmk/ec/: Event Console for log monitoring and correlation
- ...
- agents/: Monitoring agents for various platforms (Linux, Windows, etc.)
- active_checks/: Active check implementations
- notifications/: Notification plugins and handling
- packages/: Modular subprojects with individual build systems (see Package Architecture below)
- omd/: OMD (Open Monitoring Distribution) packaging and integration
- tests/: Comprehensive test suite including unit, integration, and GUI tests
The packages/ directory contains independent subprojects, each with its own run script and Bazel targets:
- cmk-ccc/: Core common components (daemon, debugging, site management)
- cmk-crypto/: Cryptographic utilities (certificates, passwords, TOTP)
- cmk-trace/: OpenTelemetry tracing integration
- cmk-messaging/: RabbitMQ messaging infrastructure
- cmk-werks/: Work changelog management and CLI tools
- cmk-mkp-tool/: MKP (Monitoring Knowledge Package) management
- cmk-events/: Event processing and notification handling
- cmk-plugin-apis/: API definitions for plugin development
- cmk-frontend-vue/: Modern Vue.js 3 frontend framework
- cmk-frontend/: Legacy frontend assets and webpack build
- cmk-shared-typing/: TypeScript type definitions shared between vue frontend and backend
- cmk-agent-receiver/: FastAPI service for receiving agent data
- cmk-agent-ctl/: Rust-based agent controller
- cmk-livestatus-client/: Python client for Livestatus queries
- cmk-relay-protocols/: Protocol definitions for relay communication
- livestatus/: C++ Livestatus query interface
- neb/: Nagios Event Broker module (C++)
- unixcat/: Unix socket communication utility (C++)
- check-cert/: SSL/TLS certificate checker (Rust)
- check-http/: HTTP/HTTPS checker (Rust)
- mk-oracle/: Oracle database monitoring (Rust)
- mk-sql/: SQL Server monitoring (Rust)
We use Bazel as the primary build system with Make for legacy compatibility.
- Use the bazel skill for all testing and linting tasks, except integration and end-to-end tests, which use make
- Always format, lint and test your code when you are done with a task
- Unit tests: Fast, isolated component testing (
tests/unit/) - Integration tests: Component interaction testing (
tests/integration/) - Composition tests: Multi-service integration (
tests/composition/) - GUI E2E tests: End-to-end web interface testing (
tests/gui_e2e/) - Plugin tests: Monitoring plugin validation (
tests/plugins_*/) - Agent plugin tests: Cross-platform agent functionality (
tests/agent-plugin-unit/)
- cmk.base: Core monitoring functionality, not GUI-dependent
- cmk.gui: Web interface and user-facing components
- cmk.utils: Shared utilities accessible across components
- cmk.ec: Event Console functionality
- Component isolation enforced - GUI cannot import base internals
- Python 3.12 for main codebase
- Agent plugins: Python 3.4+ compatible, with Python 2.7 auto-conversion
- Type hints required (mypy enforcement)
- Ruff for formatting and linting
- pathlib for file operations
- Context managers for resource handling
- pyproject.toml: Python project configuration, ruff, mypy, pytest settings
- MODULE.bazel: Bazel module dependencies and configuration
- defines.make: Version and build variable definitions
- package_versions.bzl: Centralized version management
- .bazelrc: Bazel build configuration
- constraints.txt: Python dependency constraints
The codebase supports multiple Checkmk editions:
- Checkmk Community: Open source base edition
- Checkmk Pro: Commercial with advanced features
- Checkmk Ultimate: Cloud-native monitoring
- Checkmk Ultimate with multi-tenancy: Multi-tenant MSP edition
- Checkmk Cloud: Hosted solution