How to Monitor your Linux Servers with Checkmk 2

How to Monitor your Linux Servers with Checkmk

Checkmk is an application and infrastructure monitoring solution that supports the monitoring of servers, applications, networks, containers, and clouds. Checkmk server can be installed on Ubuntu, Debian, CentOS, RHEL, and SUSE Linux Enterprise Server. It can monitor Linux, Windows, macOS, Solaris, and AIX hosts via Checkmk agents. Checkmk gives a quick overview of IT infrastructure which allows administrators to detect and troubleshoot issues that may affect server security or stability.

In today’s post, we will be showing how to install the Checkmk server on Ubuntu OS. We will also be showing how to install the Checkmk agent on Ubuntu OS.

Note: The method described here has been tested on Ubuntu 20.04 LTS. However, the same method can be followed on Debian OS.

Installing Checkmk

Checkmk is available as:

  • Raw edition

It is a complete open-source edition but does not contain all functionalities

  • Enterprise edition

It is a licensed edition that includes all functionalities. You can also test its free version (along with all functionalities) for 30 days.

We will be using Checkmk raw edition.

Step 1: Download Checkmk

To download Checkmk, visit the Checkmk website downloads page. Select the Checkmk Raw Edition, choose the latest stable version, and then choose your OS platform and OS version. Then click the Download button.

You can also use the below command to download the Checkmk latest stable version (as of this writing) 2.0.0p12:

$ wget https://download.checkmk.com/checkmk/2.0.0p12/check-mk-raw-2.0.0p12_0.focal_amd64.deb

Step 2: Install Checkmk

Now in order to install Checkmk, use the below command:

$ sudo apt install ./check-mk-raw-2.0.0p12_0.focal_amd64.deb

Enter sudo password. If it prompts for confirmation, hit y and then Enter to confirm. Checkmk along with Apache and other dependencies will be installed on your machine.

To verify if the Checkmk has been successfully installed and to see the installed version, use the command below:

$ omd version

Step 3: Adjust Firewall

To access the Checkmk web interface from another system on the network, you will need to add a rule in the firewall.

To allow outside access to the Checkmk web interface, use the below command:

$ sudo ufw allow Apache

To verify if the rule has been added, use the below command:

$ sudo ufw status

If the rule has been added, you will see Apache listed in the output.

Step 4: Create a Checkmk monitoring site

The next you will need to do is to create the Checkmk site. Let’s create our site named monitoring.

$ sudo omd create monitoring

In the output, you will find the URL, admin user, and password to access the monitoring site.

How to Monitor your Linux Servers with Checkmk 3

Now start the monitoring site by using the command below:

$ sudo omd start monitoring

How to Monitor your Linux Servers with Checkmk 4

Step 5: Access Checkmk Web Interface

You can access the Checkmk web interface by pointing your web browser to http://server-ip/site-name. Where server-ip is the IP address of the server where Checkmk is installed and site-name is the name of the Checkmk site (monitoring in our example).

http://192.168.72.186/monitoring

Login using the default credentials you got at Step 4. You can change the default credentials later on.

How to Monitor your Linux Servers with Checkmk 5

After login, you will see the Checkmk Dashboard.

How to Monitor your Linux Servers with Checkmk 6

Step 6: Install Agent on Hosts

To add a host in Checkmk for monitoring, you will need to install the Checkmk agent.

First, we will install the Checkmk agent on the Checkmk server to monitor itself. To install the Checkmk agent on our Checkmk Ubuntu server, go to Setup > Agents > Linux.

How to Monitor your Linux Servers with Checkmk 7

Then right click the check-mk-agent_2.0.0p12-1_all.deb and copy this link.

How to Monitor your Linux Servers with Checkmk 8

Now download the copied link using the wget command:

$ wget http://192.168.72.202/monitoring/check_mk/agents/check-mk-agent_2.0.0p12-1_all.deb

Once the package is downloaded, install it as follows:

$ sudo apt install -y ./check-mk-agent_1.6.0p20-1_all.deb

Then to verify if the agent is installed, use the command below:

$ check_mk_agent

You should see the below similar output:

How to Monitor your Linux Servers with Checkmk 9

Step 7: Add Host for Monitoring

Now you can add host in Checkmk for monitoring. We will add the Checkmk server to monitor itself. To add your Ubuntu server for monitoring, go to Setup from the left panel of the Checkmk web interface. Then go to Hosts > Hosts as highlighted below.

How to Monitor your Linux Servers with Checkmk 10

Then in the following window, click Add host.

How to Monitor your Linux Servers with Checkmk 11

Then enter the hostname (can also enter localhost) and IP address and then click Save & go to service configuration.

How to Monitor your Linux Servers with Checkmk 12

On the services page, you will see a list of all found services. If you see any Undecided services, click Fix all.

Then click the orange-colored sign (like 10+ changes) at the top right corner of the window.

How to Monitor your Linux Servers with Checkmk 13

Then click Activate on selected sites.

How to Monitor your Linux Servers with Checkmk 14

Now you can find your site at Monitor > Overview > All hosts. Here, you can click your host and view a list of services with their statuses and other details.

How to Monitor your Linux Servers with Checkmk 15

Similarly, you can add other hosts for Monitoring in Checkmk.

How to Monitor your Linux Servers with Checkmk 16

You can also look at the dashboard to get a quick overview by going to Monitor > Overview > Main dashboard.

How to Monitor your Linux Servers with Checkmk 17

Uninstall Checkmk Server and Agent from Ubuntu

In case you want to uninstall the Checkmk agent as well as server, you can do so as follows:

To uninstall the Checkmk agent from the Ubuntu machine, use the command below:

$ sudo apt remove check-mk-agent

Now to also remove that Ubuntu host from Checkmk server, go to Setup > Hosts >Hosts, select the host and click the delete icon.

To uninstall the Checkmk server from the Ubuntu server, use the command below:

$ sudo apt remove check-mk-raw-2.0.0p12

In this post, we described how to install Checkmk and monitor hosts in Ubuntu OS. Checkmk has agents available for different OS. Therefore, you can monitor more systems as required. In the end, we also described how to uninstall Checkmk agents as well as servers from Ubuntu in case you need to do so.

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Leave a Comment

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