How to install CheckMK on Linux Server

Giteqa

Any server requires constant monitoring and settings due to which it will be safe to use. And if applications are initially installed on the Windows server, with the help of which you can track the performance (and it's also easy to configure everything there because of the graphical environment). 

Previously, we have already reviewed some nuances that will help you configure the server, and now we will talk about other important server settings that will increase security and allow you to monitor its performance.

All commands are executed on behalf of the root user or a user with sudo privileges

Status monitoring

Downloading checkmk and setting up

For monitoring the status, the Checkmk utility is perfect for you
This utility allows you to track how components work, as well as receive notifications when something is not working correctly.

In order to install it, you need to initially check the updates for the system with the “Apt-get update” command

After that, download the utility itself using the command:

Wget https://https://checkmk.com/support/2.0.0p23/check-mk-raw-2.0.0p23_0.focal_amd64.deb

After the archive has been downloaded, it is necessary to unpack it using the command:

apt install -y ./check-mk-raw-2.0.0p23_0.focal_amd64.deb

Then just wait for the unpacking and installation to finish (This is all done by the command specified above).
When everything is installed, you can check whether this program works with the command: omd

Now, in order for everything to work stably, we need to turn on the firewall and allow the Apache server to work (It was installed together with the application.) To do this, enter the commands:

  • Ufw allow apache - allows apache
  • Ufw enable - enables the firewall
  • Ufw status - will show whether the firewall is working

Now we need to create the monitoring profile itself and for this we enter the command:

Omd create “Name”

OmdCreate

I chose the name monitor. After you run this command, just wait for the end of its download, the system will configure everything automatically.

The highlighted items indicate the address to connect to, as well as the username and password for authorization. It is at this address that you will be able to monitor the server.

Starting monitoring

The setup is complete and we need to start monitoring with the command:

Omd start name

StarrtOMD

If you have everything turned out the same as in the example above, then everything works stably and you can go to the site for verification. To go to the site, write in the address bar: http://ip_your_ubuntu_server/name _of_your_monitor/

After you go to the site, you will need to enter the login details that the console previously gave you. After you log in you will see the following:

CheckMK-main

Here you can view all the information about the server, but nothing is working here right now. We will change this a little later.

In order to make it easier for you to log in, as well as to increase the security level, you should change the login password. You can do this by clicking on User in the lower left corner and then selecting “Change Password”

After that, you will be taken to the page where you need to enter the current password and enter a new one twice.
Also in Edit profile you can change user data, for example, change the language and other data.

System monitoring

To add our server to monitoring, you need to add the check-mk-agent agent To do this, go to the settings on the website and go to the “Agent->linux” tab

Here you will see the package you need to download, it is located in “Packaged Agents”

Download exactly the version .deb
To download the agent, enter the command:

Wget http://Your_IP_ubuntuserver/name_of_monitor/check_mk/agents/check-mk-agent_version_fromsite

After you download this archive of files, you will need to install it with the command:

Apt install -y ./check-mk-agent_version

The archive has been unpacked and installed to check it, use the command: check-mk-agent

A lot of text will be output, but the most important thing is given to us at the end and it is thanks to this data that we will be able to configure checkmk

We need to configure xinetd this is required for greater server security. Open this file with any editor I open with the command:

Nano /etc/xinetd.d/check_mk

After that we will need to change the lines in the example shown below

configurecheckMK

Here we change the line with the ip address, translating it to the form 127.0.0.1
This is necessary so that only our server is viewed and that's it, and after that we save the file and restart it with the command:

Systemctl restart xinetd

Adding the server to monitoring

To add a server, go back to the monitoring site and in the settings go to the “setup->hosts” items

Here you need to enter the host name (you can specify the name of your monitoring as well), also tick the box next to IPv4 and enter 127.0.0.1 because we have already indicated that we will view our server data.

After that, save the data and enable monitoring by clicking on “Save & go to service configuration". Then just wait for the download to finish and you will see up-to-date server data, as well as CPU load data that is updated every 15 minutes.

You can update the server statistics with the “Full Service Scan” button and be sure to click on Fix all so that everything is tracked. Next, click on “Change” in the upper right corner, then activate the changes by clicking “Activate on selected sites”

After that, the settings will be saved and you can track the work from the main page.

If suddenly you have a red error, then it is critical and it should be eliminated as soon as possible. After eliminating all the errors, the polygon will just be green.
And to track more information and see, for example, the work schedule, click on one of the items. After that, you will be taken to the settings where you can observe statistics and where there will be a graph icon, you can see it simply by hovering the cursor over it.

Conclusion

In this article, we looked at how you can monitor the server performance using checkmk, which is a powerful and convenient utility. With its help, you will be able to track work schedules and over time they will be filled more and more. We also got a little familiar with the checkmk interface and how it can be used. In order for your server to work stably, you should always be attentive to its components and monitor its performance, also you can always rent a server from us and not worry about its condition.