# Checkmk Monitoring

> Checkmk infrastructure monitoring platform.

- Category: Monitoring & Observability
- Difficulty: intermediate
- Components: checkmk
- Tags: checkmk, monitoring, infrastructure, alerting, nagios
- Source: https://docker.recipes/monitoring/checkmk-monitoring

## Overview

Checkmk is a comprehensive infrastructure monitoring platform originally based on Nagios Core, developed to address the limitations of traditional monitoring systems. Born from the need for better scalability and usability, Checkmk combines active monitoring checks with passive monitoring agents to provide real-time visibility into servers, network devices, applications, and cloud resources. The platform includes both a modern web interface and powerful alerting capabilities that go far beyond basic Nagios functionality.

This Docker deployment creates a complete Checkmk RAW monitoring environment with persistent data storage and proper networking isolation. The containerized setup includes the core monitoring engine, web interface, notification system, and all necessary dependencies in a single cohesive stack. The configuration uses tmpfs mounting for temporary files to optimize performance while maintaining data persistence for monitoring configurations and historical data.

This stack is ideal for system administrators transitioning from traditional monitoring solutions, DevOps teams needing comprehensive infrastructure visibility, and organizations requiring enterprise-grade monitoring without licensing costs. The Checkmk RAW edition provides powerful monitoring capabilities including distributed monitoring, business intelligence features, and extensive plugin ecosystem, making it suitable for environments ranging from small business networks to large enterprise infrastructures.

## Features

- Native Nagios plugin compatibility with extended check capabilities and performance data collection
- Agent-based and agentless monitoring with automatic service discovery for Linux, Windows, and network devices
- Built-in business intelligence dashboards with customizable views and reporting capabilities
- Multi-site distributed monitoring architecture for geographically dispersed infrastructure
- Integrated notification system with email, SMS, and webhook support for escalation management
- Performance graphing with RRDtool integration and long-term trend analysis
- Flexible alerting rules engine with time-based conditions and maintenance window support
- REST API for automation and integration with external systems and configuration management tools

## Use cases

- Enterprise network monitoring with automated discovery of servers, switches, and network infrastructure
- Application performance monitoring for web services, databases, and custom business applications
- Cloud infrastructure monitoring across AWS, Azure, and Google Cloud Platform resources
- Compliance monitoring for security policies, system updates, and configuration drift detection
- MSP monitoring deployments with multi-tenant site management and customer separation
- DevOps pipeline monitoring for CI/CD infrastructure, build servers, and deployment environments
- Industrial IoT monitoring for manufacturing equipment, sensors, and operational technology networks

## Prerequisites

- Minimum 4GB RAM recommended for monitoring up to 1000 hosts with historical data retention
- Docker Engine 20.10+ with Docker Compose V2 for proper tmpfs and volume mounting support
- Port 8080 available for web interface access and agent communication
- Basic understanding of SNMP, SSH, and network monitoring concepts for host configuration
- Administrative access to target systems for agent installation and monitoring setup

## docker-compose.yml

```yaml
services:
  checkmk:
    image: checkmk/check-mk-raw:latest
    container_name: checkmk
    restart: unless-stopped
    ports:
      - "${CHECKMK_PORT:-8080}:5000"
    environment:
      - CMK_SITE_ID=${SITE_ID:-cmk}
      - CMK_PASSWORD=${ADMIN_PASSWORD:-cmkadmin}
    volumes:
      - checkmk_data:/omd/sites
    tmpfs:
      - /opt/omd/sites/cmk/tmp:uid=1000,gid=1000
    networks:
      - checkmk-network

volumes:
  checkmk_data:

networks:
  checkmk-network:
    driver: bridge
```

## .env

```bash
# Checkmk
CHECKMK_PORT=8080
SITE_ID=cmk
ADMIN_PASSWORD=cmkadmin
```

## Usage notes

- Checkmk at http://localhost:8080/cmk
- Login: cmkadmin/cmkadmin
- Install agents on hosts
- Based on Nagios

## Troubleshooting

- CMK site creation fails with permission errors: Ensure Docker has sufficient permissions and tmpfs is properly mounted with correct uid/gid
- Web interface shows 'Site not started' error: Check container logs for OMD service status and restart the container if necessary
- Agent discovery fails to find services: Verify network connectivity and ensure monitoring agents are properly installed with correct site configuration
- Performance graphs not displaying data: Check RRDtool permissions in the data volume and verify check intervals are configured correctly
- Email notifications not sending: Configure SMTP settings in the site configuration and test mail server connectivity from container
- High memory usage during large environment discovery: Increase container memory limits and consider adjusting discovery check intervals

