{"id":11227,"date":"2021-10-28T13:24:30","date_gmt":"2021-10-28T13:24:30","guid":{"rendered":"https:\/\/linuxways.net\/?p=11227"},"modified":"2021-10-28T13:24:30","modified_gmt":"2021-10-28T13:24:30","slug":"how-to-monitor-your-linux-servers-with-checkmk","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-monitor-your-linux-servers-with-checkmk\/","title":{"rendered":"How to Monitor your Linux Servers with Checkmk"},"content":{"rendered":"<p>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.<\/p>\n<p>In today&#8217;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.<\/p>\n<p><strong>Note<\/strong>: The method described here has been tested on <strong>Ubuntu 20.04 LTS<\/strong>. However, the same method can be followed on <strong>Debian<\/strong> OS.<\/p>\n<h2>Installing Checkmk<\/h2>\n<p>Checkmk is available as:<\/p>\n<ul>\n<li>Raw edition<\/li>\n<\/ul>\n<p>It is a complete open-source edition but does not contain all functionalities<\/p>\n<ul>\n<li>Enterprise edition<\/li>\n<\/ul>\n<p>It is a licensed edition that includes all functionalities. You can also test its free version (along with all functionalities) for 30 days.<\/p>\n<p>We will be using <strong>Checkmk raw edition<\/strong>.<\/p>\n<h3>Step 1: Download Checkmk<\/h3>\n<p>To download Checkmk, visit the Checkmk website <a href=\"https:\/\/checkmk.com\/download?edition=cre&amp;version=stable&amp;dist=ubuntu&amp;os=focal\">downloads<\/a> page. Select the Checkmk Raw Edition, choose the latest stable version, and then choose your OS platform and OS version. Then click the <strong>Download<\/strong> button.<\/p>\n<p>You can also use the below command to download the Checkmk latest stable version (as of this writing) <strong>2.0.0p12<\/strong>:<\/p>\n<pre>$ wget <a href=\"https:\/\/download.checkmk.com\/checkmk\/2.0.0p12\/check-mk-raw-2.0.0p12_0.focal_amd64.deb\">https:\/\/download.checkmk.com\/checkmk\/2.0.0p12\/check-mk-raw-2.0.0p12_0.focal_amd64.deb<\/a><\/pre>\n<h3>Step 2: Install Checkmk<\/h3>\n<p>Now in order to install Checkmk, use the below command:<\/p>\n<pre>$ sudo apt install .\/check-mk-raw-2.0.0p12_0.focal_amd64.deb<\/pre>\n<p>Enter sudo password. If it prompts for confirmation, hit <strong>y <\/strong>and then<strong> Enter <\/strong>to confirm. Checkmk along with Apache and other dependencies will be installed on your machine.<\/p>\n<p>To verify if the Checkmk has been successfully installed and to see the installed version, use the command below:<\/p>\n<pre>$ omd version<\/pre>\n<h3>Step 3: Adjust Firewall<\/h3>\n<p>To access the Checkmk web interface from another system on the network, you will need to add a rule in the firewall.<\/p>\n<p>To allow outside access to the Checkmk web interface, use the below command:<\/p>\n<pre>$ sudo ufw allow Apache<\/pre>\n<p>To verify if the rule has been added, use the below command:<\/p>\n<pre>$ sudo ufw status<\/pre>\n<p>If the rule has been added, you will see Apache listed in the output.<\/p>\n<h3>Step 4: Create a Checkmk monitoring site<\/h3>\n<p>The next you will need to do is to create the Checkmk site. Let\u2019s create our site named <strong>monitoring<\/strong>.<\/p>\n<pre>$ sudo omd create monitoring<\/pre>\n<p>In the output, you will find the <strong>URL<\/strong>, <strong>admin user<\/strong>, and <strong>password<\/strong> to access the <strong>monitoring<\/strong> site.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"988\" height=\"360\" class=\"wp-image-11228\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-314.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-314.png 988w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-314-300x109.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-314-768x280.png 768w\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" \/><\/p>\n<p>Now start the <strong>monitoring<\/strong> site by using the command below:<\/p>\n<pre>$ sudo omd start monitoring<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"205\" class=\"wp-image-11229\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-315.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-315.png 457w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-315-300x135.png 300w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<h3>Step 5: Access Checkmk Web Interface<\/h3>\n<p>You can access the Checkmk web interface by pointing your web browser to <a href=\"http:\/\/server-ip\/site-name\">http:\/\/server-ip\/site-name<\/a>. Where <strong>server-ip<\/strong> is the IP address of the server where Checkmk is installed and <strong>site-name<\/strong> is the name of the Checkmk site (<strong>monitoring<\/strong> in our example).<\/p>\n<p><a href=\"http:\/\/192.168.72.186\/monitoring\">http:\/\/192.168.72.186\/monitoring<\/a><\/p>\n<p>Login using the default credentials you got at <strong>Step 4<\/strong>. You can change the default credentials later on.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"482\" class=\"wp-image-11230\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-316.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-316.png 986w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-316-300x147.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-316-768x375.png 768w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/p>\n<p>After login, you will see the Checkmk Dashboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1152\" height=\"523\" class=\"wp-image-11231\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-317.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-317.png 1152w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-317-300x136.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-317-1024x465.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-317-768x349.png 768w\" sizes=\"auto, (max-width: 1152px) 100vw, 1152px\" \/><\/p>\n<h3>Step 6: Install Agent on Hosts<\/h3>\n<p>To add a host in Checkmk for monitoring, you will need to install the Checkmk agent.<\/p>\n<p>First, we will install the Checkmk agent on the Checkmk server to monitor itself. To install the Checkmk agent on our Checkmk <strong>Ubuntu server<\/strong>, go to <strong>Setup &gt; Agents &gt; Linux.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"819\" height=\"503\" class=\"wp-image-11232\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-318.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-318.png 819w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-318-300x184.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-318-768x472.png 768w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/p>\n<p>Then right click the <strong>check-mk-agent_2.0.0p12-1_all.deb<\/strong> and copy this link.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"876\" height=\"458\" class=\"wp-image-11233\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-319.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-319.png 876w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-319-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-319-768x402.png 768w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/p>\n<p>Now download the copied link using the wget command:<\/p>\n<pre>$ wget <a href=\"http:\/\/192.168.72.202\/monitoring\/check_mk\/agents\/check-mk-agent_2.0.0p12-1_all.deb\">http:\/\/192.168.72.202\/monitoring\/check_mk\/agents\/check-mk-agent_2.0.0p12-1_all.deb<\/a><\/pre>\n<p>Once the package is downloaded, install it as follows:<\/p>\n<pre>$ sudo apt install -y .\/check-mk-agent_1.6.0p20-1_all.deb<\/pre>\n<p>Then to verify if the agent is installed, use the command below:<\/p>\n<pre>$ check_mk_agent<\/pre>\n<p>You should see the below similar output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"354\" class=\"wp-image-11234\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-320.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-320.png 654w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-320-300x162.png 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/p>\n<h3>Step 7: Add Host for Monitoring<\/h3>\n<p>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 <strong>Setup<\/strong> from the left panel of the Checkmk web interface. Then go to <strong>Hosts &gt; Hosts<\/strong> as highlighted below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"457\" class=\"wp-image-11235\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-321.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-321.png 1200w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-321-300x114.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-321-1024x390.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-321-768x292.png 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>Then in the following window, click <strong>Add host<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1193\" height=\"437\" class=\"wp-image-11236\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-322.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-322.png 1193w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-322-300x110.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-322-1024x375.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-322-768x281.png 768w\" sizes=\"auto, (max-width: 1193px) 100vw, 1193px\" \/><\/p>\n<p>Then enter the <strong>hostname<\/strong> (can also enter localhost) and <strong>IP address<\/strong> and then click <strong>Save &amp; go to service configuration.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1025\" height=\"632\" class=\"wp-image-11237\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-323.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-323.png 1025w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-323-300x185.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-323-768x474.png 768w\" sizes=\"auto, (max-width: 1025px) 100vw, 1025px\" \/><\/p>\n<p>On the services page, you will see a list of all found services. If you see any <strong>Undecided services<\/strong>, click <strong>Fix all<\/strong>.<\/p>\n<p>Then click the orange-colored sign (like 10+ changes) at the top right corner of the window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1011\" height=\"569\" class=\"wp-image-11238\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-324.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-324.png 1011w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-324-300x169.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-324-768x432.png 768w\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" \/><\/p>\n<p>Then click <strong>Activate on selected sites<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"560\" class=\"wp-image-11239\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-325.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-325.png 991w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-325-300x170.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-325-768x434.png 768w\" sizes=\"auto, (max-width: 991px) 100vw, 991px\" \/><\/p>\n<p>Now you can find your site at <strong>Monitor<\/strong> &gt; <strong>Overview<\/strong> &gt; <strong>All hosts. <\/strong>Here, you can click your host and view a list of services with their statuses and other details.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1017\" height=\"305\" class=\"wp-image-11240\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-326.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-326.png 1017w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-326-300x90.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-326-768x230.png 768w\" sizes=\"auto, (max-width: 1017px) 100vw, 1017px\" \/><\/p>\n<p>Similarly, you can add other hosts for Monitoring in Checkmk.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1010\" height=\"316\" class=\"wp-image-11241\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-327.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-327.png 1010w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-327-300x94.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-327-768x240.png 768w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/p>\n<p>You can also look at the dashboard to get a quick overview by going to <strong>Monitor<\/strong> &gt; <strong>Overview<\/strong> &gt; <strong>Main dashboard<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1004\" height=\"566\" class=\"wp-image-11242\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-328.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-328.png 1004w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-328-300x169.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-328-768x433.png 768w\" sizes=\"auto, (max-width: 1004px) 100vw, 1004px\" \/><\/p>\n<h2>Uninstall Checkmk Server and Agent from Ubuntu<\/h2>\n<p>In case you want to uninstall the Checkmk agent as well as server, you can do so as follows:<\/p>\n<p>To uninstall the Checkmk agent from the Ubuntu machine, use the command below:<\/p>\n<pre>$ sudo apt remove check-mk-agent<\/pre>\n<p>Now to also remove that Ubuntu host from Checkmk server, go to <strong>Setup<\/strong> &gt; <strong>Hosts<\/strong> &gt;<strong>Hosts<\/strong>, select the host and click the delete icon.<\/p>\n<p>To uninstall the Checkmk server from the Ubuntu server, use the command below:<\/p>\n<pre>$ sudo apt remove check-mk-raw-2.0.0p12<\/pre>\n<p>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.<\/p>","protected":false},"excerpt":{"rendered":"<p>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,&hellip;<\/p>","protected":false},"author":1,"featured_media":11667,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,5,83,165,2],"tags":[632,35,339],"class_list":["post-11227","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-checkmk","tag-linux","tag-monitoring-tools"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11227"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11227\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11667"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}