Skip to content

Latest commit

 

History

History
 
 

check_mk

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Docker Check-MK Monitoring

This is a Dockerfile to set up Check-MK Monitoring along with Msmtp send-only mail (using Gmail, Mandrill, etc.) for notifications.

Build

  1. Ensure the correct version from the downloads page is noted in the Dockerfile. If your site requires Check-MK to run with tmpfs, remove the line in start.sh that disables it, then run the container with either --priviliged or --cap-add SYS_ADMIN.

  2. Build from Dockerfile:

     docker build -t check_mk .
    
  3. Create data-only volume. Check-MK site configurations will be auto-generated in /opt/omd/sites.

     docker create -v /opt/omd/sites -v /config --name check_mk_config myscratch true
    
  4. Edit the msmtprc and msmtp-aliases files with your email SMTP info. Default site/user is omd. Then:

     docker cp msmtprc check_mk_config:/config/
     docker cp msmtp-aliases check_mk_config:/config/
    

Run

Systemd service file is also available. Make sure to run with the --init flag to best manage the container shutdown process.

docker run -d \
           --volumes-from check_mk_config \
           -v /etc/localtime:/etc/localtime \
           -p 5000:5000 \
           --name check_mk_run \
           --init \
           check_mk

Be patient when starting (20-40 seconds). The site has to be generated initially, then regenerated on subsequent runs to make sure all the permissions and user/groups are correct. Existing site info will not be overwritten!

The default username is cmkadmin. The password is randomly set on initial site creation. Find it with:

docker logs check_mk_run | grep password

Manage

The default site name is 'default'. You can use the omd commands to control that site:

$ docker exec -it check_mk_run /bin/bash
# omd --help
# omd su default
OMD[default]:~$ ....