Gebruikershulpmiddelen

Site-hulpmiddelen


technische_naslag:sid:helmstok

Verschillen

Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.

Link naar deze vergelijking

Volgende revisie
Vorige revisie
technische_naslag:sid:helmstok [2025/02/22 17:51] – aangemaakt michelletechnische_naslag:sid:helmstok [2025/02/28 18:05] (huidige) – [Windows client] layout fix michelle
Regel 2: Regel 2:
  
 De ProxMox VM //helmstok// bevat de CheckMK POC en heet zo omdat je je eraan vast kunt houden. De ProxMox VM //helmstok// bevat de CheckMK POC en heet zo omdat je je eraan vast kunt houden.
 +
 +===== CheckMK Server =====
  
 ==== Installatie ==== ==== Installatie ====
Regel 8: Regel 10:
  
   * [[https://checkmk.com/download?platform=cmk&distribution=debian&release=bookworm&edition=cre&version=2.3.0p27]]   * [[https://checkmk.com/download?platform=cmk&distribution=debian&release=bookworm&edition=cre&version=2.3.0p27]]
 +  * [[https://docs.checkmk.com/latest/en/install_packages_debian.html]]
  
 <code bash> <code bash>
Regel 35: Regel 38:
 </code> </code>
  
 +Er rolt een berg output over je scherm, dit doet de package met Apache Webserver:
 +
 +<code bash>
 +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) ...
 +</code>
 +
 +Nu staat de basis en kan ik op onderzoek uit en gaan inrichten...
 +
 +<code bash>
 +michelle@helmstok:~$ omd version
 +OMD - Open Monitoring Distribution Version 2.3.0p27.cre
 +</code>
 +
 +==== Configuratie ====
 +
 +Nu is het tijd om CheckMK aan te slingeren, dus:
 +
 +<code bash>
 +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:
 +</code>
 +
 +Nu kan ik inloggen op [[http://helmstok/poc]] met gebruiker //cmkadmin// en het voor mij bekende root-WW.
 +
 +===== CheckMK POC =====
 +
 +==== 1e onderzoek: hoe ziet de server eruit? ====
 +
 +=== Disk indeling ===
 +
 +We gaan eens kijken wat die package zoal op mijn systeem heeft gedonderd:
 +
 +<code bash>
 +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
 +</code>
 +
 +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?
 +
 +<code bash>
 +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>
 +</code>
 +
 +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...
 +
 +=== Reboot proof? ===
 +
 +Ja dus:
 +
 +<code bash>
 +michelle@helmstok:~$ sudo omd status
 +Doing 'status' on site poc:
 +agent-receiver: running
 +mkeventd:       running
 +rrdcached:      running
 +npcd:           running
 +nagios:         running
 +apache:         running
 +redis:          running
 +crontab:        running
 +-----------------------
 +Overall state:  running
 +</code>
 +
 +==== 2e onderzoek: clients toevoegen ====
 +
 +Ik heb de youtube video bekeken en kwam er vervolgens achter dat je aan de linkerkant kunt kiezen voor:
 +
 +  * Setup -> Agents -> Linux of Windows
 +
 +En daar vervolgens een .deb, .rpm of .msi kunt downloaden. Ziet er goed uit! Dus:
 +
 +<code bash>
 +wget http://helmstok/poc/check_mk/agents/check-mk-agent_2.3.0p27-1_all.deb
 +</code>
 +
 +En dat installeren. Vervolgens kun je een agent toevoegen, laten we beginnen met de POC server itself:
 +
 +  * Setup -> Hosts -> Hosts -> Add a system to the monitoring
 +
 +Ik vul in host //helmstok// en omdat dat resolved hoef ik niks te doen qua IP-adres of zuks. Na een scan van de host komt er een waslijst tevoorschijn van te monitoren zaken en ik kies er 8 uit. Daarna rechts bovenin CheckMK klikken op "9 changes" om de boel te activeren, en nogmaals Activate om het echt te doen. Nu worden er zaken gemonitord. Binnenkort maar eens kijken wat dat doet qua grafiekjes, en de RHEL server en Windows 11 VM toevoegen...
 +
 +===== CheckMK Client =====
 +
 +Er worden diverse agents meegeleverd die je kunt downloaden vanuit de web-interface. Ik heb 3 smaken geprobeerd, 2 Linux versies en eentje op Windows. Voor alle versies geldt dat zij TLS kunnen maar standaard niet doen. Daarvoor moet je op de client het volgende uitvoeren:
 +
 +<code bash>
 +cmk-agent-ctl register --server helmstok --site poc --user cmkadmin --hostname <host>
 +</code>
 +
 +==== Debian/Ubuntu client ====
 +
 +==== RHEL client ====
 +
 +Download de RPM vanaf de CheckMK server, ik gebruik hiervoor het wget-commando:
 +<code bash>
 +[michelle@pettenmepper ~]$ wget http://helmstok/poc/check_mk/agents/check-mk-agent-2.3.0p27-1.noarch.rpm
 +</code>
 +
 +Daarna installeer en configureer je het ding via de webinterface en //lijkt// het te werken. Maar als je de firewall opent gaat het opeens stukken beter...
 +
 +<code bash>
 +[michelle@pettenmepper ~]$ sudo firewall-cmd --add-port=6556/tcp
 +</code>
 +
 +Nu is het bijna netjes. Alleen klaagt het ding dat 'ie graag TLS wil gebruiken voor de client. Dus registreren we 'm nog even netjes vanaf de client:
 +
 +<code bash>
 +[michelle@pettenmepper ~]$ sudo cmk-agent-ctl register --server helmstok --site poc --user cmkadmin --hostname pettenmepper
 +Attempting to register at helmstok, port 8000. Server certificate details:
 +
 +PEM-encoded certificate:
 +-----BEGIN CERTIFICATE-----
 +MIIFJDCCAwygAwIBAgIUcC9vE0AdwI4rEcaydq4fiUE5x6cwDQYJKoZIhvcNAQEN
 +BQAwOTEcMBoGA1UEAwwTU2l0ZSAncG9jJyBsb2NhbCBDQTEZMBcGA1UECgwQQ2hl
 +Y2ttayBTaXRlIHBvYzAeFw0yNTAyMjIxNzE0MzFaFw0zNTAyMjIxNzE0MzFaMA4x
 +DDAKBgNVBAMMA3BvYzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALVJ
 +LTTgFiaM9zlOXkH3KCD3vRABz57ijvc6SOgf27ApnRyNAwOpXaxHTB8UCOnDBtMz
 +595nEjXXdmJSk9Bo1EdKHxFRpDkEtkWS6A2O316gKAO3Z7VjrGWT122TrlrIu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
 +ihcjcW7lzV0sdt3q9+k18JtkwErUbdi6YM4/K1JmoE+l6FfmdUJRwGhnf6OJov1+
 +spH8YSr2rumR/HgN5Ms7jNhCMZ+M4fKkzwuk7zwLxAp899o9lIFH7zc2M5DUTRBj
 +Bt0KQDhXOnXYjnBIR/2Urh3xCjGMn+kCjve6YdS9HgJXtK8CEOWOcpMUjyBMWhN0
 +A6iceTEJ0kZTZRiJSyeeEkUmCq27cMJPCOrR3gk2S2lGkugGQ4Bk2J3adDfcwsxm
 +S5CfJ1amjzrkp1YWg2Ny7agffzu8ijU6tHPPu3DZncHHla4gLbGFlKjV8BYWYzfZ
 +0YVH34Je6YabHZe58A/8XeT+s7Vc6AWN
 +-----END CERTIFICATE-----
 +
 +Issued by:
 +        Site 'poc' local CA
 +Issued to:
 +        poc
 +Validity:
 +        From Sat, 22 Feb 2025 17:14:31 +0000
 +        To   Thu, 22 Feb 2035 17:14:31 +0000
 +
 +Do you want to establish this connection? [Y/n]
 +> y
 +
 +Please enter password for 'cmkadmin'
 +
 +Registration complete.
 +</code>
 +
 +==== Windows client ====
 +
 +De Windows-client komt in de vorm van een MSI welke je kunt downloaden vanuit de web-interface:
 +
 +  * Setup -> Agents -> Windows -> check_mk_agent.msi
 +
 +Als die erop staat kun je 'm configureren. Heb erg in de volgende stappen:
 +
 +  * cmk-agent-ctl staat in <code bash>C:\Program Files (x86)\checkmk\service\cmk-agent-ctl.exe</code> en om daarbij te kunnen moet je je OpdrachtPrompt of PowerShell wel even als Administrator uitvoeren.
 +  * ICMP echo (ping) moet je aanzetten in de Windows Defender Firewall onder //Regels voor binnenkomende verbindingen// en dan //Bestands- en printerdeling (Echoaanvraag - ICMPv4-In)// en //Bestands- en printerdeling (Echoaanvraag - ICMPv6-In)//
technische_naslag/sid/helmstok.1740243085.txt.gz · Laatst gewijzigd: 2025/02/22 17:51 door michelle