Dit is een oude revisie van het document!
Introductie
De ProxMox VM helmstok bevat de CheckMK POC en heet zo omdat je je eraan vast kunt houden.
Installatie
Handleidingen:
michelle@helmstok:~$ sudo apt install ./check-mk-raw-2.3.0p27_0.bookworm_amd64.deb [sudo] wachtwoord voor michelle: Pakketlijsten worden ingelezen... Klaar Boom van vereisten wordt opgebouwd... Klaar De statusinformatie wordt gelezen... Klaar Let op, 'check-mk-raw-2.3.0p27' wordt geselecteerd in plaats van './check-mk-raw-2.3.0p27_0.bookworm_amd64.deb' De volgende extra pakketten zullen geïnstalleerd worden: apache2 apache2-bin apache2-data apache2-utils bc curl debugedit dialog dirmngr fontconfig fontconfig-config fonts-dejavu-core fonts-liberation2 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm graphviz libabsl20220623 libann0 libaom3 libapache2-mod-php8.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libarchive13 libassuan0 libavahi-client3 libavahi-common-data libavahi-common3 libavif15 libcairo2 libcdt5 libcgraph6 libcups2 libcurl4 libdatrie1 libdav1d6 libde265-0 libdeflate0 libdw1 libestr0 libevent-2.1-7 libfastjson4 libfontconfig1 libfreeradius3 libfribidi0 libfsverity0 libgav1-1 libgd3 libgomp1 libgpgme11 libgraphite2-3 libgsf-1-114 libgsf-1-common libgts-0.7-5 libgts-bin libgvc6 libgvpr2 libharfbuzz0b libheif1 libice6 libjbig0 libjpeg62-turbo libksba8 liblab-gamut1 liblcms2-2 libldb2 liblerc4 liblognorm5 libltdl7 liblua5.3-0 libncurses6 libnl-3-200 libnpth0 libnspr4 libnss3 libopenjp2-7 libpango-1.0-0 libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpathplan4 libpcap0.8 libpcre3 libpixman-1-0 libpoppler126 libpq5 libpython3.11 librav1e0 librpm9 librpmbuild9 librpmio9 librpmsign9 libsm6 libsmbclient libsvtav1enc1 libtalloc2 libtdb1 libtevent0 libthai-data libthai0 libtiff6 libwbclient0 libwebp7 libx265-199 libxaw7 libxcb-render0 libxcb-shm0 libxft2 libxmu6 libxpm4 libxrender1 libxslt1.1 libxt6 libyuv0 php php-cgi php-common php-gd php-pear php-sqlite3 php-xml php8.2 php8.2-cgi php8.2-cli php8.2-common php8.2-gd php8.2-opcache php8.2-readline php8.2-sqlite3 php8.2-xml pinentry-curses poppler-data poppler-utils psmisc python3-gpg python3-ldb python3-samba python3-talloc python3-tdb rpcbind rpm rpm-common rpm2cpio rsync rsyslog samba-common samba-common-bin samba-dsdb-modules samba-libs smbclient ssl-cert time update-inetd x11-common xinetd Voorgestelde pakketten: apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser pinentry-gnome3 tor parcimonie xloadimage scdaemon gsfonts graphviz-doc lrzip cups-common libgd-tools liblcms2-utils libpangox-1.0-0 pinentry-doc ghostscript fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic | fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming fonts-nanum alien elfutils rpmlint rpm-i18n python3-braceexpand rsyslog-mysql | rsyslog-pgsql rsyslog-mongodb rsyslog-doc rsyslog-openssl | rsyslog-gnutls rsyslog-gssapi rsyslog-relp heimdal-clients python3-markdown python3-dnspython cifs-utils De volgende NIEUWE pakketten zullen geïnstalleerd worden: apache2 apache2-bin apache2-data apache2-utils bc check-mk-raw-2.3.0p27 curl debugedit dialog dirmngr fontconfig fontconfig-config fonts-dejavu-core fonts-liberation2 gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm graphviz libabsl20220623 libann0 libaom3 libapache2-mod-php8.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libarchive13 libassuan0 libavahi-client3 libavahi-common-data libavahi-common3 libavif15 libcairo2 libcdt5 libcgraph6 libcups2 libcurl4 libdatrie1 libdav1d6 libde265-0 libdeflate0 libdw1 libestr0 libevent-2.1-7 libfastjson4 libfontconfig1 libfreeradius3 libfribidi0 libfsverity0 libgav1-1 libgd3 libgomp1 libgpgme11 libgraphite2-3 libgsf-1-114 libgsf-1-common libgts-0.7-5 libgts-bin libgvc6 libgvpr2 libharfbuzz0b libheif1 libice6 libjbig0 libjpeg62-turbo libksba8 liblab-gamut1 liblcms2-2 libldb2 liblerc4 liblognorm5 libltdl7 liblua5.3-0 libncurses6 libnl-3-200 libnpth0 libnspr4 libnss3 libopenjp2-7 libpango-1.0-0 libpango1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpathplan4 libpcap0.8 libpcre3 libpixman-1-0 libpoppler126 libpq5 libpython3.11 librav1e0 librpm9 librpmbuild9 librpmio9 librpmsign9 libsm6 libsmbclient libsvtav1enc1 libtalloc2 libtdb1 libtevent0 libthai-data libthai0 libtiff6 libwbclient0 libwebp7 libx265-199 libxaw7 libxcb-render0 libxcb-shm0 libxft2 libxmu6 libxpm4 libxrender1 libxslt1.1 libxt6 libyuv0 php php-cgi php-common php-gd php-pear php-sqlite3 php-xml php8.2 php8.2-cgi php8.2-cli php8.2-common php8.2-gd php8.2-opcache php8.2-readline php8.2-sqlite3 php8.2-xml pinentry-curses poppler-data poppler-utils psmisc python3-gpg python3-ldb python3-samba python3-talloc python3-tdb rpcbind rpm rpm-common rpm2cpio rsync rsyslog samba-common samba-common-bin samba-dsdb-modules samba-libs smbclient ssl-cert time update-inetd x11-common xinetd 0 opgewaardeerd, 165 nieuw geïnstalleerd, 0 te verwijderen en 0 niet opgewaardeerd. Er moeten 73,2 MB/279 MB aan archieven opgehaald worden. Na deze bewerking zal er 1.373 MB extra schijfruimte gebruikt worden. Wilt u doorgaan? [J/n]
Er rolt een berg output over je scherm, dit doet de package met Apache Webserver:
Instellen van apache2 (2.4.62-1~deb12u2) ... Enabling module mpm_event. Enabling module authz_core. Enabling module authz_host. Enabling module authn_core. Enabling module auth_basic. Enabling module access_compat. Enabling module authn_file. Enabling module authz_user. Enabling module alias. Enabling module dir. Enabling module autoindex. Enabling module env. Enabling module mime. Enabling module negotiation. Enabling module setenvif. Enabling module filter. Enabling module deflate. Enabling module status. Enabling module reqtimeout. Enabling conf charset. Enabling conf localized-error-pages. Enabling conf other-vhosts-access-log. Enabling conf security. Enabling conf serve-cgi-bin. Enabling site 000-default. info: Switch to mpm prefork for package libapache2-mod-php8.2 Module mpm_event disabled. Enabling module mpm_prefork. info: Executing deferred 'a2enmod php8.2' for package libapache2-mod-php8.2 Enabling module php8.2. Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service. Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service. Instellen van libxaw7:amd64 (2:1.0.14-1) ... Instellen van php8.2 (8.2.26-1~deb12u1) ... Instellen van libgvc6 (2.42.2-7+deb12u1) ... Instellen van samba-common-bin (2:4.17.12+dfsg-0+deb12u1) ... Instellen van libpango1.0-0:amd64 (1.50.12+ds-1) ... Instellen van graphviz (2.42.2-7+deb12u1) ... Instellen van php (2:8.2+93) ... Instellen van check-mk-raw-2.3.0p27 (0.bookworm) ... update-alternatives: /omd/versions/2.3.0p27.cre wordt gebruikt om in de automatische modus in /omd/versions/default (omd) te voorzien Adding system group omd Enabling conf zzz_omd. To activate the new configuration, you need to run: systemctl reload apache2 Considering dependency proxy for proxy_http: Enabling module proxy. Enabling module proxy_http. To activate the new configuration, you need to run: systemctl restart apache2 Enabling module rewrite. To activate the new configuration, you need to run: systemctl restart apache2 New default version is 2.3.0p27.cre. Installing systemd service: omd.init Disabling startup through SysV (/etc/init.d/*) scripts Activating startup during system boot Created symlink /etc/systemd/system/multi-user.target.wants/omd.service → /etc/systemd/system/omd.service. Bezig met afhandelen van triggers voor man-db (2.11.2-2) ... Bezig met afhandelen van triggers voor dbus (1.14.10-1~deb12u1) ... Bezig met afhandelen van triggers voor libc-bin (2.36-9+deb12u9) ... Bezig met afhandelen van triggers voor php8.2-cli (8.2.26-1~deb12u1) ... Bezig met afhandelen van triggers voor libapache2-mod-php8.2 (8.2.26-1~deb12u1) ... Bezig met afhandelen van triggers voor php8.2-cgi (8.2.26-1~deb12u1) ...
Nu staat de basis en kan ik op onderzoek uit en gaan inrichten…
michelle@helmstok:~$ omd version
OMD - Open Monitoring Distribution Version 2.3.0p27.cre
Configuratie
Nu is het tijd om CheckMK aan te slingeren, dus:
michelle@helmstok:~$ sudo omd create poc [sudo] wachtwoord voor michelle: Adding /opt/omd/sites/poc/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/poc/tmp...OK Updating core configuration... Generating configuration for core (type nagios)... Precompiling host checks...OK Executing post-create script "01_create-sample-config.py"...OK Executing post-create script "02_cmk-compute-api-spec"...OK Restarting Apache...OK Created new site poc with version 2.3.0p27.cre. The site can be started with omd start poc. The default web UI is available at http://helmstok/poc/ The admin user for the web applications is cmkadmin with password: *********** For command line administration of the site, log in with 'omd su poc'. After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'. michelle@helmstok:~$ sudo omd start poc Temporary filesystem already mounted Starting agent-receiver...OK Starting mkeventd...OK Starting rrdcached...OK Starting npcd...OK Starting nagios...OK Starting apache...OK Starting redis...OK Initializing Crontab...OK michelle@helmstok:~$ sudo omd su poc OMD[poc]:~$ cmk-passwd cmkadmin New password: Re-type new password:
Nu kan ik inloggen op http://helmstok/poc met gebruiker cmkadmin en het voor mij bekende root-WW.
CheckMK POC
1e onderzoek
Disk indeling
We gaan eens kijken wat die package zoal op mijn systeem heeft gedonderd:
michelle@helmstok:/etc/apache2$ ls -al /omd lrwxrwxrwx 1 root root 8 22 feb 17:49 /omd -> /opt/omd michelle@helmstok:/etc/apache2$ sudo du -hs /opt/omd 1,2G /opt/omd
Ga ik dit op de roer server parkeren moet ik dus een filesystem /opt/omd aanmaken, van 5GB of zo?
Webserver configuratie
Uit de installatie had ik al opgemaakt dat dit ding dus de Apache webserver gebruikt van de Debian GNU/Linux distributie. Hoe hebben ze dat in elkaar gestoken?
michelle@helmstok:/etc/apache2$ ls conf-available charset.conf localized-error-pages.conf other-vhosts-access-log.conf php8.2-cgi.conf security.conf serve-cgi-bin.conf zzz_omd.conf michelle@helmstok:/etc/apache2$ ls -al conf-enabled/zzz_omd.conf lrwxrwxrwx 1 root root 30 22 feb 17:49 conf-enabled/zzz_omd.conf -> ../conf-available/zzz_omd.conf michelle@helmstok:/etc/apache2$ cat conf-enabled/zzz_omd.conf Include /omd/apache/*.conf michelle@helmstok:/etc/apache2$ ls /omd/apache/*.conf /omd/apache/empty.conf /omd/apache/poc.conf michelle@helmstok:/etc/apache2$ cat /omd/apache/poc.conf # version: 2 # This file is managed by 'omd' and will automatically be overwritten. Better do not edit manually # Make sure that symlink /omd does not make problems <Directory /> Options +FollowSymlinks </Directory> <IfModule mod_proxy_http.c> ProxyRequests Off ProxyPreserveHost On <Proxy http://127.0.0.1:5000/poc> Order allow,deny allow from all </Proxy> <Location /poc> # Setting "retry=0" to prevent 60 second caching of problem states e.g. when # the site apache is down and someone tries to access the page. # "disablereuse=On" prevents the apache from keeping the connection which leads to # wrong devlivered pages sometimes ProxyPass http://127.0.0.1:5000/poc retry=0 disablereuse=On timeout=120 ProxyPassReverse http://127.0.0.1:5000/poc </Location> </IfModule> <IfModule !mod_proxy_http.c> Alias /poc /omd/sites/poc <Directory /omd/sites/poc> Deny from all ErrorDocument 403 "<h1>Checkmk: Incomplete Apache Installation</h1>You need mod_proxy and mod_proxy_http in order to run the web interface of Checkmk." </Directory> </IfModule> <Location /poc> ErrorDocument 503 "<meta http-equiv='refresh' content='60'><h1>Checkmk: Site Not Started</h1>You need to start this site in order to access the web interface.<!-- IE shows its own short useless error message otherwise: placeholder -->" </Location>
Kortom: Het heeft netjes z'n eigen config maar is wel een beetje tam met z'n HTTP en een URL die naar de site is vernoemd. Idee voor de roer server: de site tijdens configuratie checkmk noemen zodat de URL iets wordt wat ik graag wil…