How to Install Check_MK on CentOS 7

      2 Comments on How to Install Check_MK on CentOS 7

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]

Servers
I have created 2 servers.
* CentOS 7 – Check_MK Server (10.40.0.209)
* Windows Server 2012 R2 – Host (10.4.0.52)

Prerequisites
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

If you’re using FirewallD open port UDP 123 or allow the NTP service.
In our case I will allow NTP as a service

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.

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

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

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

If you’re also using SELinux please create a rule so that httpd Can access the network.

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.

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.

We need to start the site the make it available
Note: The values may be different from those below.

Now that we created and started the site we can access it through the Web browser with the URL:
http://10.40.0.209/monitor01/

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:
http://10.40.0.209/monitor01/check_mk/agents/windows/check_mk_agent.msi

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.

2 thoughts on “How to Install Check_MK on CentOS 7

  1. Sven Willemen

    Hello Kevin,

    I’m learning this stuff – and encountering a small issue that regardless of which tutorial i use, seems to come up again and again. On the installation of check_mk itself, the command [user@checkmk01 tmp]$ sudo wget https://mathias-kettner.de/support/1.4.0p24/check-mk-raw-1.4.0p24-el7-71.x86_64.rpm refers to a specific version. In my case i get an error: Error 404: not found. If i then replace the version by the current version “sudo wget https://mathias-kettner.de/support/1.5.0p6/check-mk-raw-1.5.0p6-el7-38.x86_64.rpm it again gives me an error (I’m using CentOS 7).

    Any idea how to get the correct version in Kevin?

    Thanks in advance!

    Reply
    1. Kevin Tijssen Post author

      Hi Sven,

      What error message did you get?
      I’ve tested it on my own system (CentOS 7) and didn’t got any error messages.

      user@checkmk01:~$ sudo wget https://mathias-kettner.de/support/1.5.0p6/check-mk-raw-1.5.0p6-el7-38.x86_64.rpm
      [sudo] password for user:
      –2018-10-19 18:53:17– https://mathias-kettner.de/support/1.5.0p6/check-mk-raw-1.5.0p6-el7-38.x86_64.rpm
      Resolving mathias-kettner.de (mathias-kettner.de)… 178.248.246.154
      Connecting to mathias-kettner.de (mathias-kettner.de)|178.248.246.154|:443… connected.
      HTTP request sent, awaiting response… 200 OK
      Length: 123979588 (118M) [application/x-redhat-package-manager]
      Saving to: ‘check-mk-raw-1.5.0p6-el7-38.x86_64.rpm’

      check-mk-raw-1.5.0p6-el7-38.x 100%[==============================================>] 118.24M 10.9MB/s in 13s

      2018-10-19 18:53:30 (9.24 MB/s) – ‘check-mk-raw-1.5.0p6-el7-38.x86_64.rpm’ saved [123979588/123979588]

      user@checkmk01:~$

      You can also download it to you computer and upload it with WinSCP (Windows).

      Regards

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *