Easy monitoring with Checkmk

Check It

© Lead Image © amasterpics123, 123rf.com

© Lead Image © amasterpics123, 123rf.com

Article from Issue 257/2022
Author(s):

We'll show you how to use the Checkmk open source monitoring tool to monitor your home router.

Every organization needs monitoring to make sure that servers, networks, applications, cloud assets, and other elements work as they should. Monitoring also provides timely alerts, and it helps IT teams track down the causes of (potential) problems. Having a suitable monitoring tool will help you resolve problems faster, ideally before they have an impact on operational systems. Checkmk [1] is an open source monitoring tool that is ideally suited for modern hybrid environments, combining enterprise-grade scalability and security with the extendibility of open source software.

In most cases, Checkmk runs on a dedicated server or virtual machine (VM). As I am just running a small monitoring setup for my home office environment, my host will be my computer with Ubuntu 18.04. The computer has four CPU cores and 4GB of RAM, which is more than enough to get started. Checkmk also runs on other Linux distributions, such as Debian, Red Hat Enterprise Linux, CentOS, or SUSE Linux Enterprise Server, and you can also run Checkmk on a Docker container or virtual appliance. If you install Checkmk on a dedicated host, the only additional steps you need are transferring the files to the server.

Checkmk can monitor anything with an IP address, including servers, cloud assets, and network devices, as well as systems that belong to the Internet of Things (IoT). For this article, I chose to monitor my TP-Link router. Checkmk also comes ready-equipped with reasonable thresholds for alerts. These pre-configured thresholds will come in handy, because your monitoring will be up and running within a few minutes without you having to worry about setting up alerts.

Choose a Checkmk Edition

You can use Checkmk for free. For this tutorial, I chose the Checkmk Raw Edition. You could also start with the Checkmk Free Edition, the free version of the Checkmk Enterprise Edition, which provides additional features. After 30 days, the Free Edition is limited to 25 hosts. The Checkmk Raw Edition is completely open source and permanently free.

Checkmk started as a front-end for the Nagios [2] open source monitoring tool several years ago, but it became a stand-alone monitoring solution in 2012 and has replaced almost all Nagios components. The Checkmk Raw Edition still uses the Nagios monitoring core as a utility. To get started with Checkmk, go to the download section on the project website [3], where you will find the latest versions. Select the Checkmk Raw Edition, choose the latest stable version (this tutorial is based on version 2.0.0p13), and then choose your platform and your OS version. Click the download button and download the package.

Once the download has finished, you will need to install the package, including all of dependencies. Installation steps vary depending on your distro. In my case, I will switch to the terminal and go to my download folder, and then run apt install as root (see Figure 1):

apt install ./check-mk-raw-2.0.0p13_0.bionic_amd64.deb
Figure 1: Installing Checkmk.

Once the installation is completed, you can perform a test. The command omd should be accessible now. The following command:

omd version

should return the details of the Checkmk version you are currently using.

The omd command stands for Open Monitoring Distribution (OMD), an open source project created by Mathias Kettner, the founder of Checkmk [4]. The OMD project includes monitoring solutions assembled from various components.

Create Your Checkmk Monitoring Site

The next step is to start an initial monitoring site (a site is also known as an instance). Make sure you are still root and use omd create to create a new Checkmk site and name it as you wish (Figure 2). This tutorial uses cmk_tutorial:

omd create cmk_tutorial
Figure 2: Creating a monitoring site.

At the end of the output, you should now see the information about how to start and access your Checkmk site (Figure 3). You can follow the steps to change your admin password in the terminal, but I prefer to do that in the Checkmk user interface.

Figure 3: The installation ends with instructions for how to access the site. Be sure to change the password – either at the command line or through the Checkmk user interface.

Copy the randomly generated password (you will need it in the next step), and start your monitoring site with omd start:

omd start cmk_tutorial

Should you want to drill deeper into Checkmk later on, it is important to understand what has just taken place. By creating a new Checkmk site, you have created a new user, which is known as the site user, and a group with the name of the site on your server. A directory for the site will have been created under /omd/sites, (e.g., /omd/sites/cmk_tutorial). Checkmk also copied its default configuration into the new directory, and a user with the name cmkadmin has been created for the Checkmk web interface.

Start Monitoring with Checkmk

Before you go to the Checkmk user interface, think about the systems you want to monitor. For this tutorial, I will monitor my TP-Link TD-W9960v router with the classic protocol Simple Network Monitoring Protocol (SNMP). If you also want to monitor systems with SNMP, you should make sure the SNMP agent is active on your device. In my case, I had to activate it in my router's web interface, and I decided to keep the SNMP community set to the default value public. (In a real-world setting, you will want to change this community string rather than using the default value.)

Once you are sure the host you want to monitor is ready to provide the monitoring data, it is time to switch to the Checkmk user interface in your browser. Every Checkmk site has its own URL, which consists of your monitoring server's IP address or host name and the name of the Checkmk site. In my example, this is 127.0.0.1/cmk_tutorial.

Open the link to your Checkmk site in your browser. You can open the link shown on your terminal. Log in with cmkadmin and the password you copied from the terminal. You will see an empty dashboard. Go to User in the sidebar on the left and, under Profile, click on Change password to change your password (recommended).

After that you can start adding hosts to your monitoring (Figure 4). In my case, I will add my router. Go to Setup | Hosts and click on Add host

Figure 4: Adding a host for Checkmk to monitor.

In my example, I only have to add the hostname tplinkmodem.net, because TP-Link set up the DNS for their devices and, thus, Checkmk can resolve the IP address for your hostname automatically. I recommend using this option, if available. If that is not the case, you will also need to add your device's IP address by activating the checkbox next to IPv4 address and entering the IP address.

For my router, I want to work with SNMP, but by default, Checkmk assumes that you use the Checkmk agents to monitor systems. The Checkmk agents are great for monitoring servers, but on most network devices, you cannot install additional software. Thus, go to Monitoring agents, check the box Checkmk agent/API integrations, and choose no agent.

Next, check the box labeled SNMP (Figure 5). Choose your SNMP version – SNMP v2 or v3 works in most cases. Because I did not change the SNMP community, I can leave the SNMP credentials box unchecked – by default, Checkmk assumes that the password is public. If that is not the case, you have to set the community string under SNMP credentials. Leave the other items unchanged.

Figure 5: Choose a monitoring agent in the Add host dialog box.

Next, click on Save & go to service configuration. Checkmk will now automatically discover any relevant monitoring services on that host, and you should then see a list of Undecided services.

Click on Fix all to monitor all of these relevant services (Figure 6). That will add all of the detected services to the monitoring and will also remove services that have vanished. You can manage the services manually, of course, but the Fix all function makes it a lot easier.

Figure 6: Click the Fix all button to monitor all relevant services.

In this case, Checkmk simply detected all of my router's ports that are currently online, plus the uptime and the SNMP info check – 10 services in total for me. If there is an official check plugin available for your device, Checkmk will detect relevant information automatically. The 2,000 official check plugins cover the equipment from most common professional network vendors. This collection of plugins makes Checkmk a great tool for network monitoring and saves you a lot of time.

I recommend the blog post "Network Monitoring with Checkmk" [5] for further information on monitoring with SNMP. But before you start with outside reading, follow the last step to complete this tutorial.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News