CMK version: 2.3.0p42 RAW OS version: Docker 29.2.1, Ubuntu Server 25.10
I’m trying to transition my checkmk installation from an older linux machine to a more modern virtualized environment using Docker.
I’ve largely succeeded except for two things:
When I perform a “docker compose up”, apache2 will not start. I have to get into the container shell and invoke “omd update-apache-config”, then “service apache2 start”.
When I perform a container restart after this, I have to get into the container shell and invoke “service apache2 start”.
How can I get the update-apache-config to be persistent?
How can I get apache2 to start reliably when the container starts?
Docker compose file follows (site name is “abc”). Note that I also had to work-around the problem of avoiding an underscore in the time zone name.
I’ve sorted out the persistence of the omd update-apache-config command. I had to:
Define a volume for the /etc/apache2 directory
Start the container for the first time
Run omd update-apache-config
After that, the apache2 configuration remains persistent across container restarts or updates.
This ought to be documented somewhere and shown in examples. I’ve included my current Docker Compose file below.
I am still searching for a solution to the problem of the apache2 service not starting when the container starts. Any help with this problem would be most appreciated.
Inside the CheckMK container there should be no running system Apache. Only the site Apache.
The container setup documentation will show how a working compose file should look like.
You will have only two ports that are really needed 8000 for the TLS registration and some other port 8080 (from the documentation) to the internal site Apache port 5000.
Yes, I understand. I am referring to the apache instance that runs inside the container. Or perhaps I should say, it runs inside the container only after I access the container shell and start it manually.
Again, yes, I used that as my initial model for my compose file, so I am familiar.
I have remote agents that need 6556, and I have other hosts with SNMP that need to be monitored so I need 161 and 162.
Somewhat more subtle is that something in the copy of my site that I backed up from the stand-alone Checkmk instance to the Docker host machine is forcing port 80 instead of 5000. If I load up a completely blank Docker instance of Checkmk with a fresh, empty site, it does utilize 5000, but not with the copy of my existing site. At any rate, that doesn’t really matter.
Back to focusing on the problem: apache (inside the container) won’t start when the container starts. I can only guess that it is an order of operations problem, that something in the container is not ready when apache goes to start. I should add this happens with a completely new Checkmk Docker instance with a default and empty “cmk” site and the default ports. Thus it does not appear to have anything to do with my site database that I brought over.
I’m not certain what internal container logs to look at. Any suggestions?
My apologies. Your post got me thinking, and reading, and even though I’ve been running checkmk a long time, I had no idea that apache was part of OMD!
I’ve updated my site configuration, which did deviate from the defaults. It now reads:
OMD[abc]:~$ omd config show
ADMIN_MAIL:
AGENT_RECEIVER: on
AGENT_RECEIVER_PORT: 8000
APACHE_MODE: own
APACHE_TCP_ADDR: 127.0.0.1
APACHE_TCP_PORT: 5000
AUTOSTART: on
CORE: nagios
LIVESTATUS_TCP: off
MKEVENTD: on
MKEVENTD_SNMPTRAP: off
MKEVENTD_SYSLOG: off
MKEVENTD_SYSLOG_TCP: off
MULTISITE_AUTHORISATION: on
MULTISITE_COOKIE_AUTH: on
PNP4NAGIOS: on
TMPFS: on