Location>code7788 >text

Install Checkmk monitoring system on Ubuntu Server

Popularity:797 ℃/2025-05-04 11:19:57

1. Preparation before installation

  1. Update the system and install dependencies

    sudo apt update && sudo apt upgrade -y
    sudo apt install -y wget apt-transport-https

2. Install Checkmk (open source version)

  1. Add Checkmk repository

    wget /support/1.6.0p30/check-mk-raw-2.1.0p30_0.jammy_amd64.deb
    sudo dpkg -i check-mk-raw-2.1.0p30_0.jammy_amd64.deb
    sudo apt install -f
  2. Create a monitoring instance

    sudo omd create monitoring
    sudo omd start monitoring
  3. Open firewall port (HTTP/HTTPS)

    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    sudo ufw reload

3. Access the web interface

  1. Visithttp://your-server-ip/monitoring, use the default credentials to log in:

    • usernamecmkadmin

    • password: Password generated during installation (view/omd/sites/monitoring/etc/htpasswd)。


Configure the monitored device


1. Monitor Linux servers

  1. Install Checkmk Agent on the target server

    wget http://<checkmk-server-ip>/monitoring/check_mk/agents/check-mk-agent_2.1.0p30-1_all.deb
    sudo dpkg -i check-mk-agent_*.deb
    sudo systemctl restart xinetd  # Make sure the xinetd service is running
  2. Adding hosts in Checkmk web interface

    • Navigate toSetup > Hosts > Add host

    • Enter the host name and IP address and selectCheckmk AgentMonitoring method.

    • ClickSave & Run Service Discovery, apply changes.


2. Monitor network equipment (switch/router/firewall)

  1. Enable SNMP on the device(Take Cisco equipment as an example):

    ! Enter configuration mode
     configure terminal
     snmp-server community YourCommunityString RO# Set read-only community strings
     snmp-serverhost <checkmk-server-ip> version 2c YourCommunityString
    exit
  2. Add SNMP device in Checkmk

    • Navigate toSetup > Hosts > Add host

    • Enter the device name and IP address and selectSNMPMonitoring method.

    • Configure SNMP version (such as v2c) and community strings.

    • ClickSave & Run Service Discovery, check the interface traffic monitoring item (such asInterface statistics)。


3. Monitoring fortress machine (taking Linux fortress machine as an example)

  1. Monitoring via SSH or Agent

    • If SNMP is supported, add it according to network device.

    • If SNMP is not supported, use Checkmk Agent (same as Linux server steps).


Configure interface traffic monitoring

  1. Enable interface monitoring in service discovery results

    • Click on the host pageService Discovery

    • Check the interface to monitor (such asInterface Ethernet0)。

    • ClickActivateApply changes.

  2. Custom traffic thresholds

    • Navigate toSetup > Hosts > Services, select interface service.

    • ReviseCheck parametersSet an alarm threshold (such as an alarm that the bandwidth utilization rate exceeds 80%).


Timely backup platform data

1. Manual backup

sudo omd backup monitoring  # Backup files are stored in `/var/lib/omd/backups/` by default

2. Automatic backup (Cron task)

  1. Create a backup script

    sudo nano /usr/local/bin/checkmk_backup.sh
    #!/bin/bash
    omd backup monitoring > /dev/null
    find /var/lib/omd/backups/ -name "*." -mtime +30 -exec rm {} \;
  2. Set up timing tasks

    crontab -e
    0 2 * * * /usr/local/bin/checkmk_backup.sh  # Every morning2Click Backup

Daily maintenance matters

  1. Monitoring log

    • Checkmk log path:/omd/sites/monitoring/var/log/.

    • examineandIs there any error?

  2. Update Checkmk

    sudo apt update
    sudo apt install check-mk-raw-<New version number>
    sudo omd update monitoring
  3. Clean up old data

    • Adjust data retention policy in the web interface:Setup > General > Global Settings > History


Things to note

  1. SNMP Security

    • Use SNMPv3 instead of v2c (Configure Encrypted User).

    • Restrict SNMP access to IP (via device ACL or firewall).

  2. Permission Management

    • Using CheckmkRoles & UsersFunctional assignment minimum permissions.

    • Avoid using default passwords and change credentials regularly.

  3. High availability

    • If there are more than 500 monitoring devices, consider distributed deployment (master-slave monitoring node).

  4. Resource monitoring

    • Monitor Checkmk server resources (CPU/memory/disk) to avoid data loss due to excessive load.

  5. Firewall rules

    • Allows Checkmk server to access the SNMP (UDP 161) and Agent (TCP 6556) ports of the device.


Troubleshooting example

  • SNMP monitoring failed

    snmpwalk -v2c -c YourCommunityString <device IP> 1.3.6.1.2.1.1.1.0  # Test SNMP connectivity
  • Agent has no data

    telnet <Target server IP> 6556  # Check whether the Agent port is open