Now and then I post a new version of the Nutanix Check for Check_MK but I never wrote a manual how to install Check_MK.
What is Check_MK?
Check_MK is a light weight monitoring program which uses the Nagios core.
It’s scalable, allowing us to monitor more systems and detects all the services which can be monitored. Each server can monitor up to 35000 service checks. It has agents for Unix (AIX/Ubuntu/Debian/RHEL/CentOS/Fedora/openSuse), Windows and Specials agents.
The “Special agents” are a special alternative to the normal Check_MK-agents.
As an example my own Nutanix check. Nutanix doesn’t allow/like to have additional software installed on the CVM, however instead of using the agent I’m using the WebAPI of Nutanix
Architecture of a Monitoring-Solution based on Check_MK
Note: Please be aware there are 2 versions of Check_MK:
– The CRE sersion (Check_MK Raw Edition, Free)
– The CEE version (Check_MK Enterprise Edition, Subscription needed)
I will show you how to install the free version of Check_MK (CRE)
Note: This guide is written for CentOS 7 and written for a non-root user.
Commands that require elevated privileges are prefixed with [sudo]
I have created 2 servers.
* CentOS 7 – Check_MK Server (10.40.0.209)
* Windows Server 2012 R2 – Host (10.4.0.52)
First we need to install NTP and wget.
Time is essential to get an accurate monitoring system and we need wget to download the Check_MK package
[user@checkmk01 ~]$ sudo yum install ntp wget -y [user@checkmk01 ~]$ sudo systemctl start ntpd [user@checkmk01 ~]$ sudo systemctl enable ntpd [user@checkmk01 ~]$ sudo systemctl status ntpd
If you’re using FirewallD open port UDP 123 or allow the NTP service.
In our case I will allow NTP as a service
[user@checkmk01 ~]$ sudo firewall-cmd --add-service=ntp --zone=public --permanent [user@checkmk01 ~]$ sudo firewall-cmd --reload
We need to have the EPEL repository installed on our system, as Check_MK uses some packages that are not available on default repo’s but are available on EPEL repo’s.
[user@checkmk01 ~]$ sudo yum install epel-release -y
Installation of Check_MK
First we need to download the Check_MK Server package from http://mathias-kettner.com/check_mk_download.php?HTML=yes
As mentioned above, we’re installed the free version of Check_MK
[user@checkmk01 ~]$ cd /tmp [user@checkmk01 tmp]$ sudo wget https://mathias-kettner.de/support/1.4.0p24/check-mk-raw-1.4.0p24-el7-71.x86_64.rpm
Now we will install the package. We’re using yum instead of rpm cause it will also install all the dependencies required for Check_MK
[user@checkmk01 tmp]$ sudo yum install check-mk-raw-1.4.0p24-el7-71.x86_64.rpm -y
If you’re using FirewallD open port TCP 80/443 or the HTTP/HTTPs service.
In our case I will only allow HTTP as a service cause I won’t be using HTTPs
[user@checkmk01 tmp]$ sudo firewall-cmd --add-service=http --zone=public --permanent [user@checkmk01 tmp]$ sudo firewall-cmd --reload
If you’re also using SELinux please create a rule so that httpd Can access the network.
[user@checkmk01 tmp]$ sudo setsebool -P httpd_can_network_connect 1
Configuration of Check_MK
Now that we have installed Check_MK we need to create a Site. An “Site” is a monitoring instance on the Check_MK Server. You can create multiple sites on a server, for example a Production and Test site or one site per server to create a distributed monitoring solution.
To create a site, execute the following command.
[user@checkmk01 tmp]$ sudo omd create monitor01
The output will looking similar to the following, and will have two pieces of critical information.
The URL where you can access the Check_MK Server and the login credentials
Note: The values may be different from those below.
[user@checkmk01 tmp]$ sudo omd create monitor01 Adding /opt/omd/sites/monitor01/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/monitor01/tmp...OK Restarting Apache...OK Created new site monitor01 with version 1.4.0p24.cre. The site can be started with omd start monitor01. The default web UI is available at http://10.40.0.209/monitor01/ The admin user for the web applications is cmkadmin with password: MRG30BvD (It can be changed with 'htpasswd -m ~/etc/htpasswd cmkadmin' as site user. ) Please do a su - monitor01 for administration of this site.
We need to start the site the make it available
Note: The values may be different from those below.
[user@checkmk01 tmp]$ sudo omd start monitor01 Starting mkeventd...OK Starting rrdcached...OK Starting npcd...OK Starting nagios...2018-01-29 21:19:45  updating log file index 2018-01-29 21:19:45  updating log file index OK Starting dedicated Apache for site monitor01...OK Initializing Crontab...OK
Now that we created and started the site we can access it through the Web browser with the URL:
Use the credentials from the output when you created the site.
Once we’re logged in we will see an empty dashboard cause there are no servers & services configured.
Now we will add a Windows Host to Check_MK, but first we need to install a Check_MK Agent.
We can download and install the agent from the Check_MK Server by using the following URL:
When the installation is complete, we can add the host to the Check_MK Server
Navigate in the Check_MK dashboard to “WATO-Configuration”, select “Hosts” and click “Create new host”
Enter a “Hostname”, “IP or FQDN address”, set Agent Type to “Check_MK Agent” and click “Save & go to Services”
Check_MK will now try to discover all possible services that can be monitored. This can take a few seconds. Once discovered click “Fix all missing/vanished”
Now we only need to activate the changes by clicking on “2 changes”
If you have some suggestions or tips, just leave a comment below.
Thanks for reading.