DeskTux

Linux on Desktops

User Tools

Site Tools


apps:checkmk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
apps:checkmk [2020-09-19 15:22] – created jensapps:checkmk [2023-06-24 16:46] (current) jens
Line 2: Line 2:
 [[https://checkmk.com|CheckMK]] is a great monitoring solution that can be used for free if you want to know what is going on with e.g. your [[Puppet]] server or your own [[independence|Mail- and Cloud server]]. [[https://checkmk.com|CheckMK]] is a great monitoring solution that can be used for free if you want to know what is going on with e.g. your [[Puppet]] server or your own [[independence|Mail- and Cloud server]].
  
-If you want to use it for free, there are two different options. Either you use CheckMK Raw, which does not offer all features of the Enterprise Edition, or you use CheckMK Free which offers all features but is limited to 10 hosts. For me the limit of 10 hosts is not enough so I use CheckMK Raw for my needs. For a comparison of the available editions you should check out the [[https://checkmk.com/editions.html|official site]].+If you want to use it for free, there are two different options. Either you use CheckMK Raw, which does not offer all features of the Enterprise Edition, or you use CheckMK Free which offers all features but is limited to a certain amount of hosts/servicesI prefer Open Source Software whenever possible, so I use CheckMK Raw for my needs. For a comparison of the available editions you should check out the [[https://checkmk.com/editions.html|official site]].
  
 The [[https://checkmk.com/cms.html|documentation]] of CheckMK is superb and I really urge you to use it. Here I just want to describe some specialties which are either not part of CheckMK, or where the documentation is not 100% clear. The [[https://checkmk.com/cms.html|documentation]] of CheckMK is superb and I really urge you to use it. Here I just want to describe some specialties which are either not part of CheckMK, or where the documentation is not 100% clear.
  
-===== CheckMK =====+===== Puppet ===== 
 +<WRAP center round info> 
 +Note that this section needs a complete overhaul and I will probably have to write my own check for this. The upstream projects seem to be dead and the checks have to be rewritten in Python. Well, I like Python but time is always an issue. So take the info below with a huge grain of salt, it will not work anymore on modern CheckMK versions! 
 +</WRAP> 
 If you are using [[Puppet]] for configuration and state management, and you are not using the Enterprise edition, it is quite difficult to have an overview of the state of your Puppet runs (especially the failing ones). If you are using [[Puppet]] for configuration and state management, and you are not using the Enterprise edition, it is quite difficult to have an overview of the state of your Puppet runs (especially the failing ones).
  
Line 13: Line 17:
 His Plugin is based on either the Puppet Enterprise Edition, or another distribution than Debian however, so some slight modifications are necessary. His Plugin is based on either the Puppet Enterprise Edition, or another distribution than Debian however, so some slight modifications are necessary.
  
 +The plugin comes with a script that reads out the latest status of a Puppet run on the client, it looks like this in the original:
 +
 +<file bash mk_puppet>
 +#!/bin/bash
 +
 +LASTRUN="/var/lib/puppet/state/last_run_summary.yaml"
 +if [ -e "${LASTRUN}" ]; then
 +  OUT="$(cat ${LASTRUN} | sed 's/[[:space:]]\{2,\}//g')"
 +  echo "<<<check_puppet_agent>>>"
 +  echo "${OUT}" | grep 'last_run'
 +  echo "${OUT}" | grep -A8 '^resources: *$' | sed 's/^/resources_/g'
 +  echo "${OUT}" | grep -A3 '^events: *$' | sed 's/^/events_/g'
 +fi
 +</file>
 +
 +But in Debian with the Open Source edition of Puppet this file is in a different location, this is the adatped version for Debian:
 +
 +<file bash mk_puppet>
 +#!/bin/bash
 +  
 +LASTRUN="/var/cache/puppet/state/last_run_summary.yaml"
 +if [ -e "${LASTRUN}" ]; then
 +  OUT="$(cat ${LASTRUN} | sed 's/[[:space:]]\{2,\}//g')"
 +  echo "<<<check_puppet_agent>>>"
 +  echo "${OUT}" | grep 'last_run'
 +  echo "${OUT}" | grep -A8 '^resources: *$' | sed 's/^/resources_/g'
 +  echo "${OUT}" | grep -A3 '^events: *$' | sed 's/^/events_/g'
 +fi
 +</file>
 +
 +{{ :apps:puppet.png?256|}}
 +That is it already. But to be able to use that plugin you must not only distribute the above file to all clients you want to monitor into the plugin directory ''/usr/lib/check_mk_agent/plugins'' (I do that with Puppet), but you need to install it in your CheckMK server as well.
 +
 +  - Copy the ''.mkp'' file to your CheckMK server to a place where your CheckMK site user has access to it.
 +  - Switch to that user using ''su - <user>''
 +  - Install the MKP file using ''mkp install puppet-<version>.mkp''
 +
 +Now, your CheckMK installation knows about the plugin and will detect additional services on your monitored hosts. It should look something like in the screenshot on the right.
 +
 +===== Agent over SSH =====
 +<WRAP center round info>
 +This section also needs some rewriting, since the newer versions of CheckMK support SSL (sic) the documentation on running the agent over SSH has vanished. So I will try to re-create the documentation here.
 +</WRAP>
 +
 +The official documentation has a great chapter on [[https://checkmk.com/cms_agent_linux.html#ssh|invoking the Agent over SSH]]. Please read and implement that, especially for internet-facing systems the use of ''xinetd'' is not really feasible.
 +
 +One point in the documentation was not totally clear to me however, namely the part //Migrating Checkmk’s access to SSH//. There it says you have to go to ''Datasource programs -> Individual program call instead of agent access rule set.'' to activate the usage of SSH on the CheckMK server.
  
 +Well, that can be found in ''Wato -> Host & Service Parameters -> Datasource Programs -> Individual program call instead of agent access''. Just to save you some searching ;-)
apps/checkmk.1600521751.txt.gz · Last modified: 2020-09-19 15:22 by jens