Install checkmk Docker: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(19 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 2: Zeile 2:
*mkdir -p docker/checkmk
*mkdir -p docker/checkmk
*cd docker/checkmk
*cd docker/checkmk
*mkdir -p omd-checkmk
*mkdir -p omd-sites


=Dockercompose File=
=Docker Compose File=
*cat /root/docker/checkmk/docker-compose.yml
*nano docker-compose.yml
<pre>
<pre>
version: '3.1'
services:
services:
   controll:
   checkmk:
     image: checkmk/check-mk-raw:1.6.0-latest
     image: checkmk/check-mk-raw:2.3.0-latest
    container_name: checkmk
    restart: always
     tmpfs:
     tmpfs:
    - /opt/omd/sites/cmk/tmp:uid=1000,gid=1000
      - /opt/omd/sites/cmk/tmp:uid=1000,gid=1000
     ulimits:
     ulimits:
       nofile: 1024
       nofile: 49152
    container_name: checkmk
    restart: always
     volumes:
     volumes:
       - '/etc/localtime:/etc/localtime:ro'
       - /etc/localtime:/etc/localtime:ro
       - '/srv/checkmk:/omd/sites'
       - ./omd-sites:/omd/sites
     ports:
     ports:
       - '8095:5000'
       - "8095:5000"
       - '6557:6557'
       - "6557:6557"
</pre>
</pre>
=Starten manuell=
=Starten manuell=
*cd /root/docker/checkmk/
*docker compose up -d
*docker-compose up -d


=Stoppen manuell=
=Stoppen manuell=
*cd /root/docker/checkmk/
*docker compose down
*docker-compse down
 
=Systemd=
=Passwort checken=
*cat /etc/systemd/system/docker@.service
*docker container logs checkmk
<pre>
Created new site cmk with version 2.3.0.cre.
[Unit]
Description=Docker compose %i  service
Requires=docker.service
After=docker.service


[Service]
  The site can be started with omd start cmk.
Type=oneshot
  The default web UI is available at http://<container_id>/cmk/
RemainAfterExit=yes
WorkingDirectory=/root/docker/%i
ExecStart=/usr/bin/docker-compose up -d
ExecStop=/usr/bin/docker-compose down
TimeoutStartSec=60


[Install]
  The admin user for the web applications is cmkadmin with password: <zufälliges_passwort>
WantedBy=multi-user.target
  For command line administration of the site, log in with 'omd su cmk'.
  After logging in, you can change the password for cmkadmin with 'htpasswd etc/htpasswd cmkadmin'.


</pre>
=cmkadmin Passwort setzen=
=starten, enablen=
*systemctl start docker@checkmk.service
*systemctl enable docker@checkmk.service
=cmkadmin passwort setzen=
*docker exec -it checkmk /bin/bash
*docker exec -it checkmk /bin/bash
*su - cmk
*su - cmk
*<nowiki>OMD[cmk]:>#~$</nowiki> htpasswd -m ~/etc/htpasswd cmkadmin
*OMD[cmk]:~$ cmk-passwd cmkadmin
*exit
*exit
*exit
=Todo=
*certbot
*letsencrypt
*reverseproxy

Aktuelle Version vom 16. September 2025, 19:07 Uhr

Verzeichnisse anlegen

  • mkdir -p docker/checkmk
  • cd docker/checkmk
  • mkdir -p omd-sites

Docker Compose File

  • nano docker-compose.yml
services:
  checkmk:
    image: checkmk/check-mk-raw:2.3.0-latest
    container_name: checkmk
    restart: always
    tmpfs:
      - /opt/omd/sites/cmk/tmp:uid=1000,gid=1000
    ulimits:
      nofile: 49152
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./omd-sites:/omd/sites
    ports:
      - "8095:5000"
      - "6557:6557"

Starten manuell

  • docker compose up -d

Stoppen manuell

  • docker compose down

Passwort checken

  • docker container logs checkmk

Created new site cmk with version 2.3.0.cre.

 The site can be started with omd start cmk.
 The default web UI is available at http://<container_id>/cmk/
 The admin user for the web applications is cmkadmin with password: <zufälliges_passwort>
 For command line administration of the site, log in with 'omd su cmk'.
 After logging in, you can change the password for cmkadmin with 'htpasswd etc/htpasswd cmkadmin'.

cmkadmin Passwort setzen

  • docker exec -it checkmk /bin/bash
  • su - cmk
  • OMD[cmk]:~$ cmk-passwd cmkadmin
  • exit