IT Infrastructure monitoring is complex, but a tool like Checkmk makes it easier.
Many organizations have added cloud-native technologies to their tech stack to enhance the performance of their products. At the same time, they often continue to run their own networks and on-premises infrastructure. This shift to hybrid infrastructures needs to be addressed in monitoring due to the huge number of metrics being generated every second for various components such as operating system, storage, server, cloud environments, etc. They all are important to make sure applications run at peak performance.
These metrics are an essential signal for DevOps teams to understand the health of their infrastructure. This is why organizations need a monitoring solution to help them quickly identify issues in production with metrics, visualizations, and analytics. Checkmk is one of the most popular and helpful infrastructure monitoring tools. In this article, I will tell you why Checkmk deserves its good reputation and how you can take the first steps with it.
What is Checkmk?
Checkmk constantly checks the function of any aspect of modern IT environments and is especially well-suited for hybrid infrastructures. On the one hand, Checkmk is flexible and supports containers, cloud assets, and on-premises systems such as switches and servers. On the other hand, it is really easy to get started and manage your monitoring, because Checkmk comes with automatic alerts based on a lot of IT expertise and other intelligent features that will save you a lot of time.
If you want to use Checkmk for free, you have two options: First, you can go for the Checkmk Raw Edition, which is completely open-source and free to use without any limitations. Second, there is the Checkmk Enterprise Trial Edition that has all the additional features of the Checkmk Enterprise Editions, but after 30 days the number of hosts will be limited to 25.
How does Checkmk solve the problem?
Checkmk can monitor applications, servers, databases, networks, containers, storage, and whatnot. It provides a massive list of over 2,000 monitoring plug-ins. With these plug-ins. Checkmk can be extended to monitor specific technologies from different vendors available on the market. A few popular Checkmk plug-ins are for Docker, Kubernetes, Cisco, Nginx, VMware, Linux, Windows, AWS, Dell. With its 2,000+ plug-ins, Checkmk stands out as a very promising infrastructure monitoring solution available currently.
Also, for any monitoring solution, it is crucial how fast and correctly they can read the metrics and set up smart alerting and notifications. Checkmk’s solution meets all these criteria. With its auto-discovery feature, Checkmk can identify more than 90% of services and devices. Now, most businesses require scalability and automation. You can scale monitoring capacity from hundred hosts to thousands of hosts with ease in Checkmk and leverage its agents available for automation.
Install Checkmk in a Docker container
In this article, I am going to install the Checkmk Raw Edition in a Docker container on a Linux server running on Ubuntu 20.04. From Dockerhub, you can download the Checkmk Docker container. It has almost 5 million+ pulls so far, which tells how popular and widely used Checkmk is.
Take the Docker image with the latest Checkmk version and run it inside a container by using the command docker container run.
You can check if the Docker image got downloaded by running the command docker images.
geekflare@geekflare:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
bitnami/node-exporter latest ba0f519ca49b 34 hours ago 104MB
checkmk/check-mk-raw 2.0.0-latest 097319702432 13 days ago 1.03GB
hello-world latest feb5d9fea6a5 7 weeks ago 13.3kB
Run the command docker ps to see if the Checkmk container is running.
geekflare@geekflare:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9729e323a840 checkmk/check-mk-raw:2.0.0-latest "/docker-entrypoint.…" About a minute ago Up 59 seconds (health: starting) 6557/tcp, 0.0.0.0:8080->5000/tcp, :::8080->5000/tcp monitoring
3d3a95ed3c25 bitnami/node-exporter:latest "/opt/bitnami/node-e…" 25 hours ago Up 25 hours 9100/tcp node-exporter
To get the login details for the Checkmk web interface, print the Checkmk container log.
geekflare@geekflare:~$ sudo docker container logs 9729e323a840
### CREATING SITE 'cmk'
Adding /opt/omd/sites/cmk/tmp to /etc/fstab.
Going to set TMPFS to off.
Temporary filesystem already mounted
Updating core configuration...
Generating configuration for core (type nagios)...Precompiling host checks...OK
Executing post-create script "01_create-sample-config.py"...OK
Created new site cmk with version 2.0.0p15.cre.
The site can be started with omd start cmk.
The default web UI is available at http://9729e323a840/cmk/
The admin user for the web applications is cmkadmin with password: ClFxBPre
For command line administration of the site, log in with 'omd su cmk'.
After logging in, you can change the password for cmkadmin with 'htpasswd etc/htpasswd cmkadmin'.
### STARTING XINETD
[ ok ] Starting internet superserver: xinetd.
### STARTING SITE
Temporary filesystem already mounted
### STARTING CRON
### CONTAINER STARTED
The Checkmk Docker container will run by default at https://localhost:8080/cmk/check_mk. The output of the above command tells you the username is cmkadmin and the password, in my case the password is ClFxBPre. Open the address in a web browser and use your credentials to log in.
Once you log in, this is the ’Main dashboard’ that will appear. It is empty because you did not add any hosts yet.
Monitor Docker Using Checkmk
Usually, you would install the Checkmk agent on your machine that is hosting your Docker containers and then use the Checkmk plug-in for Docker to monitor all containers. This plug-in (mk_docker.py) uses Docker’s Python-API to track Docker containers and gain full visibility into their real-time status and performance. You can read more details about Docker monitoring with Checkmk on the Checkmk website.
Because in my Docker environment there is only one Docker container running, my Checkmk Docker container, I will just use the Checkmk agent running in the Docker container and will not install the Checkmk on my Docker host. The agent is pre-installed in the Checkmk container, thus, I just have to add my Checkmk container as host.
Let’s get the IP address on which the Docker service is running by using ifconfig on the terminal.
In my case, the Docker service is running on 172.17.0.1. The next step is to add the Docker service as a host in Checkmk so that it can be monitored.
Go to Checkmk and click on Setup -> Hosts.
Click on “Add host.”
Now provide the hostname and the IP address and click on ‘Save & go to the service configuration’.
Once you do that, Checkmk will start the service discovery automatically.
Scroll down to see the monitoring services running under the Docker host. You can see the services are not getting monitored currently. If you want to monitor everything, the easiest solution is clicking on ‘Fix all’. If you want to configure which services should be monitored, you can do this in detail as well. Click on the + sign if you want to monitor a service.
Once you select the services you want to monitor, they will come in the ‘Monitored services’ tab. You will get all the status details for each service you are monitoring. If you click on ? sign, that service will move to the undecided services list. If you click on the X sign, the service will move to the ‘Disabled services’ tab.
I have disabled four services, so I can see them in the disables services tab.
When you are done with adding the services, you need to activate the changes before they go into production.
Click on the highlighted field with the yellow exclamation point (!) at the top right corner to see the pending changes.
Click on Activate on selected sites.
You have successfully monitored Docker services using Checkmk!
So that was all about Checkmk, an infrastructure monitoring tool. It is a very easy-to-use tool that you must try to monitor your production environments. I recommend trying the Checkmk Free Edition to start your monitoring.
Google Knowledge Panel are the boxes that appear on Google when you search for specific entities such as people, organizations, or places. They are meant to give you a quick understanding through boxes about the information you are looking for.
Statistical analysis provides a systematic and objective approach to extracting meaningful insights from data. It helps in making evidence-based decisions, drawing reliable conclusions, and understanding the inherent variability and uncertainties in various processes and systems.