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.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Linux Server monitoring queries.
In this context, we shall look into how to install the Checkmk server on Ubuntu OS. We will also be showing how to install the Checkmk agent on Ubuntu OS.
Steps to install 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.
In this tutorial, We will be using Checkmk raw edition.
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
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
How to configure firewall for Checkmk ?
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.
How to create a Checkmk monitoring site ?
Here, we 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.
Now start the monitoring site by using the command below:
$ sudo omd start monitoring
How to 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):
Login using the default credentials you got previously. You can change the default credentials later on.
After login, you will see the Checkmk Dashboard.
How to 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.
Then right click the check-mk-agent_2.0.0p12-1_all.deb and copy this link.
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:
How to 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.
Then in the Main directory window, click Add host.
Then enter the hostname (can also enter localhost) and IP address and then click Save & go to service configuration.
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.
Then click Activate on selected sites.
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.
Similarly, you can add other hosts for Monitoring in Checkmk.
You can also look at the dashboard to get a quick overview by going to Monitor > Overview > Main dashboard.
How to Uninstall Checkmk Server and Agent from Ubuntu Linux system ?
In case you want to uninstall the Checkmk agent as well as server, you can do so as follows:
1. 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.
2. To uninstall the Checkmk server from the Ubuntu server, use the command below:
$ sudo apt remove check-mk-raw-2.0.0p12
[Need to configure your Debian Linux system ? We can help you. ]