Checkmk is a powerful server and application monitoring solution, developed in Python and C++. It provides comprehensive monitoring for servers, applications, networks, containers, and cloud environments. With features like automated monitoring, agentless checks via HTTP/SNMP, over 1,900 plugins, detailed network traffic analysis, customizable dashboards, and Grafana integration, Checkmk is a versatile tool for IT infrastructure management.
Checkmk is available in four editions:
- Raw Edition: Open-source, built on Nagios.
- Free Edition: Full-featured, supports unlimited hosts for 30 days, then limited to 25 hosts.
- Enterprise Standard Edition: Advanced features, unlimited hosts.
- Enterprise Managed Edition: Designed for multi-customer environments, unlimited hosts.
This guide will walk you through installing and configuring Checkmk on Ubuntu 22.04, covering everything from firewall setup to monitoring additional hosts and enabling notifications.
Prerequisites
Before you begin, ensure you have:
- An Ubuntu 22.04 server (the Standard edition recommends at least 4 CPU cores for optimal performance).
- A non-root user with sudo privileges.
- UFW (Uncomplicated Firewall) enabled.
- A fully qualified domain name (FQDN) pointing to your server, e.g.,
checkmk.example.com. - The system updated:
sudo apt update && sudo apt upgrade
Step 1 – Configure the Firewall
Allow HTTP and HTTPS traffic through UFW:
sudo ufw allow http
sudo ufw allow https
sudo ufw status
You should see ports 80 and 443 allowed in the firewall status.
Step 2 – Install Checkmk
Download and import the GPG key:
wget https://download.checkmk.com/checkmk/Check_MK-pubkey.gpg
gpg --import Check_MK-pubkey.gpg
Download the latest Checkmk package (replace with your preferred edition/version):
wget https://download.checkmk.com/checkmk/2.1.0p11/check-mk-free-2.1.0p11_0.jammy_amd64.deb
sudo apt install ./check-mk-free-2.1.0p11_0.jammy_amd64.deb
Verify the installation:
omd version
Step 3 – Create a Checkmk Site
Create a new monitoring site:
sudo omd create congdonglinux
Start the site:
sudo omd start congdonglinux
Check the site’s status:
sudo omd status
Change the default admin password if needed:
htpasswd -m etc/htpasswd cmkadmin
Step 4 – Access the Checkmk Web Interface
Open your browser and navigate to:
http://<serverIP>/congdonglinux
or
http://checkmk.example.com/congdonglinux
Log in using the credentials provided during site creation. You should see the Checkmk dashboard.
Step 5 – Enable SSL with Certbot
Install Certbot using Snap:
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Generate an SSL certificate:
sudo certbot certonly --apache --agree-tos --no-eff-email --staple-ocsp --preferred-challenges http -m [email protected] -d checkmk.example.com
Test renewal:
sudo certbot renew --dry-run
Step 6 – Configure Apache for SSL
Enable required Apache modules:
sudo a2enmod headers
sudo a2enmod ssl
sudo a2enmod http2
Create /etc/apache2/sites-enabled/congdonglinux.conf and configure it for HTTPS redirection and SSL. Also, create /etc/apache2/conf-available/ssl-params.conf with secure SSL settings as shown in the original guide.
Disable the default site and enable the new configuration:
sudo a2dissite 000-default.conf
sudo a2ensite congdonglinux.conf
sudo a2enconf ssl-params
sudo apache2ctl configtest
sudo systemctl restart apache2
Step 7 – Install the Checkmk Monitoring Agent
To monitor additional hosts, install the Checkmk agent:
- In the Checkmk web interface, go to Setup > Agents > Windows, Linux, Solaris, AIX.
- Download the Linux agent
.debpackage. - On the target host, install the agent:
wget https://checkmk.example.com/congdonglinux/check_mk/agents/check-mk-agent_2.1.0p11-1_all.deb
sudo apt install ./check-mk-agent_2.1.0p11-1_all.deb
- Verify installation:
check_mk_agent
- Open port 6556 on the firewall:
sudo ufw allow 6556
- Register the host with the Checkmk server (if using SSL):
sudo cmk-agent-ctl register --hostname localhost --server checkmk.example.com:443 --site congdonglinux --user cmkadmin
Step 8 – Add Hosts for Monitoring
In the web interface:
- Go to Setup > Hosts > Hosts and click Add Host.
- Enter the hostname and IP address.
- Save and proceed to service configuration.
- Fix any undecided services and activate changes.
Your new host and its services will now appear on the dashboard.
Step 9 – Enable Email Notifications
To receive alerts:
- Set up an SMTP relay (e.g., Postfix or Sendmail) on your server.
- In Checkmk, go to Setup > Users > Users, edit your user, and add your email address.
- Adjust notification rules via the bell icon next to your username.
- Configure a fallback email address in Global Settings > Fallback email address for notifications.
- Activate changes to start receiving notifications.
Step 10 – Upgrade Checkmk
To upgrade:
- Download and install the new Checkmk package:
wget https://download.checkmk.com/checkmk/2.1.0p11/check-mk-raw-2.1.0p11_0.jammy_amd64.deb
sudo apt install ./check-mk-raw-2.1.0p11_0.jammy_amd64.deb
- List available versions:
omd versions
- Create a new site or update an existing one:
sudo omd create testsite
sudo omd su testsite
omd update
- Confirm the version:
omd version
Conclusion
Checkmk provides a robust and scalable solution for monitoring your IT infrastructure. By following these steps, you can install, configure, and manage Checkmk on Ubuntu 22.04, monitor multiple hosts, and receive timely notifications about your systems’ health.










Add Comment