{"id":10709,"date":"2021-10-17T15:29:05","date_gmt":"2021-10-17T12:29:05","guid":{"rendered":"https:\/\/kifarunix.com\/?p=10709"},"modified":"2024-03-18T13:32:11","modified_gmt":"2024-03-18T10:32:11","slug":"how-to-monitor-it-infrastructure-using-checkmk","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-monitor-it-infrastructure-using-checkmk\/","title":{"rendered":"How to Monitor IT Infrastructure using Checkmk"},"content":{"rendered":"\n
In this tutorial, you will learn how to monitor IT infrastructure using Checkmk. Checkmk<\/a> is a free and Open Source IT infrastructure monitoring tool, alternative to Nagios. It provides a powerful monitoring of networks, servers, clouds, containers and applications. Fast. Effective<\/em>.<\/p>\n\n\n\n This is an awesome tool. Read more about it on the features page<\/a>.<\/p>\n\n\n\n Checkmk can only be installed on a Linux box. As of this writing, it currently support these Linux distros;<\/p>\n\n\n\n In this tutorial, we will be installing Checkmk on an Ubuntu 20.04 server.<\/p>\n\n\n\n There exists various versions of Checkmk to choose from;<\/p>\n\n\n\n Read more about these versions on Product Editions page<\/a>.<\/p>\n\n\n\n In this tutorial, we will install the Free Edition version, Checkmk Enterprise Free Edition (CFE).<\/p>\n\n\n\n Hence, navigate to the downloads page<\/a> and;<\/p>\n\n\n\n You can simply get the download link and pull it directly to the server on which you will install Checkmk;<\/p>\n\n\n\n Verify the integrity of the downloaded installer by comparing the SHA256 hash value for the download file and the hash on the downloads page.<\/p>\n\n\n\n Get the calculated hash above and compare with the hash on the downloads page;<\/p>\n\n\n\n If the exit status is 0, then the hash values are same and hence, integrity of the file is fine.<\/p>\n\n\n\n Run system update and install the Checkmk package on Ubuntu 20.04;<\/p>\n\n\n\n The command will install Checkmk and all required package dependencies.<\/p>\n\n\n\n Installation of Checkmk provides an To setup Checkmk web UI, you need to create a monitoring instances<\/em>, which can be referred to as a site.<\/p>\n\n\n\n To create a site, use the omd command, which takes the syntax;<\/p>\n\n\n\n For example, to create a monitoring instance called kifarunix;<\/p>\n\n\n\n There are command line options you can pass to the command, see Sample site creation command output;<\/p>\n\n\n\n Once the site is created, you can start it with the command, When you create a site for your monitoring server, the commands gives the URL for accessing the site, for example, In my setup, I will just replace the hostname, ubuntu20<\/strong>, with my servers IP address, 192.168.59.23<\/strong> such that my url is Ensure Apache Web Server is up and running;<\/p>\n\n\n\n If it is not running, then start and enable it to run on system boot as follows;<\/p>\n\n\n\n Open Web server port on firewall, if at all firewall is enabled and running.<\/p>\n\n\n\n Then access the Checkmk web interface from the browser using your appropriate URL.<\/p>\n\n\n Login with the credentials that you were provided with when you ran You reset the credentials as follows;<\/p>\n\n\n\n Replace NAME-of-SITE with your respective site name, e.g;<\/p>\n\n\n\n Next, run the command below to reset the web app admin (cmkadmin) credentials.<\/p>\n\n\n\n Upon successful login to Checkmk web interface, such a dashboard welcomes you.<\/p>\n\n\n\n Beautiful, isn’t it?<\/p>\n\n\n\n As you can see, no host\/service is being monitored by default. You need to have agents installed on the hosts to be monitored in order to poll the necessary metrics and start monitoring your infrastructure.<\/p>\n\n\n\n We will cover how to install Checkmk Monitoring agents on Linux and Windows system in our next guides, link given below;<\/p>\n\n\n\n How to Install Checkmk Monitoring Agents on Linux<\/a><\/p>\n\n\n\n Installation on Debian and Ubuntu<\/a><\/p>\n\n\n\n Install Nagios on Debian 11<\/a><\/p>\n\n\n\n Install Nagios NRPE Agent on Rocky Linux 8<\/a><\/p>\n\n\n\nMonitoring IT Infrastructure using Checkmk<\/h2>\n\n\n\n
Install Checkmk on Ubuntu 20.04 Server<\/h3>\n\n\n\n
\n
Download Appropriate Checkmk package<\/h4>\n\n\n\n
\n
\n
wget https:\/\/download.checkmk.com\/checkmk\/2.0.0p12\/check-mk-free-2.0.0p12_0.focal_amd64.deb<\/code><\/pre>\n\n\n\n
sha256sum check-mk-free-2.0.0p12_0.focal_amd64.deb<\/code><\/pre>\n\n\n\n
cf62edcaea7b0d24371ba1859aec11f7979e2550c2976fcc21060f2b86e39ebf check-mk-free-2.0.0p12_0.focal_amd64.deb<\/code><\/pre>\n\n\n\n
[ \"cf62edcaea7b0d24371ba1859aec11f7979e2550c2976fcc21060f2b86e39ebf\" = \"cf62edcaea7b0d24371ba1859aec11f7979e2550c2976fcc21060f2b86e39ebf\" ]<\/code><\/pre>\n\n\n\n
echo $?<\/code><\/pre>\n\n\n\n
Install Checkmk on Ubuntu 20.04 Server<\/h4>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
apt install .\/check-mk-free-2.0.0p12_0.focal_amd64.deb<\/code><\/pre>\n\n\n\n
Reading package lists... Done\nBuilding dependency tree \nReading state information... Done\nNote, selecting 'check-mk-free-2.0.0p12' instead of '.\/check-mk-free-2.0.0p12_0.focal_amd64.deb'\nThe following additional packages will be installed:\n apache2 apache2-bin apache2-data apache2-utils binutils binutils-common binutils-x86-64-linux-gnu debugedit dialog fontconfig fontconfig-config fonts-dejavu-core\n fonts-liberation freeradius-common freeradius-config freeradius-utils graphviz lcab libann0 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap\n libavahi-client3 libavahi-common-data libavahi-common3 libbinutils libcairo2 libcdt5 libcgraph6 libctf-nobfd0 libctf0 libcups2 libdatrie1 libdbi-perl libdbi1 libdw1\n libfontconfig1 libfreeradius3 libgd3 libgraphite2-3 libgsf-1-114 libgsf-1-common libgts-0.7-5 libgts-bin libgvc6 libgvpr2 libharfbuzz0b libice6 libjansson4 libjbig0\n libjpeg-turbo8 libjpeg8 liblab-gamut1 liblcms2-2 libldb2 liblua5.2-0 libnspr4 libnss3 libopenjp2-7 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpathplan4\n libpixman-1-0 libpoppler97 libpq5 librpm8 librpmbuild8 librpmio8 librpmsign8 libsm6 libsmbclient libtalloc2 libtevent0 libthai-data libthai0 libtiff5 libtirpc-common\n libtirpc3 libwbclient0 libwebp6 libxaw7 libxcb-render0 libxcb-shm0 libxmu6 libxpm4 libxrender1 libxt6 make php-cgi php-cli php-common php-gd php-pear php-sqlite3\n php-xml php7.4-cgi php7.4-cli php7.4-common php7.4-gd php7.4-json php7.4-opcache php7.4-readline php7.4-sqlite3 php7.4-xml poppler-data poppler-utils python3-crypto\n python3-gpg python3-ldb python3-samba python3-talloc python3-tdb rpcbind rpm rpm-common rpm2cpio samba-common samba-common-bin samba-dsdb-modules samba-libs smbclient\n ssl-cert traceroute unzip update-inetd x11-common xinetd\nSuggested packages:\n apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser binutils-doc rpm-i18n gsfonts graphviz-doc cabextract cups-common libclone-perl libmldbm-perl\n libnet-daemon-perl libsql-statement-perl libgd-tools liblcms2-utils make-doc ghostscript fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic\n | fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming fonts-nanum alien python elfutils rpmlint rpm2html heimdal-clients python3-markdown python3-dnspython\n cifs-utils openssl-blacklist zip\nThe following NEW packages will be installed:\n apache2 apache2-bin apache2-data apache2-utils binutils binutils-common binutils-x86-64-linux-gnu check-mk-free-2.0.0p12 debugedit dialog fontconfig fontconfig-config\n fonts-dejavu-core fonts-liberation freeradius-common freeradius-config freeradius-utils graphviz lcab libann0 libapr1 libaprutil1 libaprutil1-dbd-sqlite3\n libaprutil1-ldap libavahi-client3 libavahi-common-data libavahi-common3 libbinutils libcairo2 libcdt5 libcgraph6 libctf-nobfd0 libctf0 libcups2 libdatrie1 libdbi-perl\n libdbi1 libdw1 libfontconfig1 libfreeradius3 libgd3 libgraphite2-3 libgsf-1-114 libgsf-1-common libgts-0.7-5 libgts-bin libgvc6 libgvpr2 libharfbuzz0b libice6\n libjansson4 libjbig0 libjpeg-turbo8 libjpeg8 liblab-gamut1 liblcms2-2 libldb2 liblua5.2-0 libnspr4 libnss3 libopenjp2-7 libpango-1.0-0 libpangocairo-1.0-0\n libpangoft2-1.0-0 libpathplan4 libpixman-1-0 libpoppler97 libpq5 librpm8 librpmbuild8 librpmio8 librpmsign8 libsm6 libsmbclient libtalloc2 libtevent0 libthai-data\n libthai0 libtiff5 libtirpc-common libtirpc3 libwbclient0 libwebp6 libxaw7 libxcb-render0 libxcb-shm0 libxmu6 libxpm4 libxrender1 libxt6 make php-cgi php-cli php-common\n php-gd php-pear php-sqlite3 php-xml php7.4-cgi php7.4-cli php7.4-common php7.4-gd php7.4-json php7.4-opcache php7.4-readline php7.4-sqlite3 php7.4-xml poppler-data\n poppler-utils python3-crypto python3-gpg python3-ldb python3-samba python3-talloc python3-tdb rpcbind rpm rpm-common rpm2cpio samba-common samba-common-bin\n samba-dsdb-modules samba-libs smbclient ssl-cert traceroute unzip update-inetd x11-common xinetd\n0 upgraded, 130 newly installed, 0 to remove and 127 not upgraded.\nNeed to get 33.2 MB\/209 MB of archives.\nAfter this operation, 920 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] y\n<\/code><\/pre>\n\n\n\n
Setup Checkmk Web User Interface<\/h3>\n\n\n\n
Open Monitoring Distribution tool<\/code><\/strong>,
omd<\/strong><\/code>, an administration interface for creating and maintaining sites (monitoring instances<\/em>) within OMD.<\/p>\n\n\n\n
Creating Checkmk Site<\/h4>\n\n\n\n
omd create [OPTIONS] NAME-of-SITE<\/code><\/pre>\n\n\n\n
\n
omd create kifarunix<\/code><\/pre>\n\n\n\n
man omd<\/code>.<\/p>\n\n\n\n
Adding \/opt\/omd\/sites\/kifarunix\/tmp to \/etc\/fstab.\nCreating temporary filesystem \/omd\/sites\/kifarunix\/tmp...OK\nUpdating core configuration...\nGenerating configuration for core (type cmc)...Creating helper config...OK\nOK\nExecuting post-create script \"01_create-sample-config.py\"...OK\nCreated new site kifarunix with version 2.0.0p12.cfe.\n\n The site can be started with omd start kifarunix.\n The default web UI is available at http:\/\/ubuntu20\/kifarunix\/\n\n The admin user for the web applications is cmkadmin with password: kFYhb3jT\n For command line administration of the site, log in with 'omd su kifarunix'.\n After logging in, you can change the password for cmkadmin with 'htpasswd etc\/htpasswd cmkadmin'.\n<\/code><\/pre>\n\n\n\n
\n
Starting Checkmk Site<\/h4>\n\n\n\n
omd start<\/code>.<\/p>\n\n\n\n
omd start<\/code><\/pre>\n\n\n\n
Doing 'start' on site kifarunix:\nTemporary filesystem already mounted\nStarting mkeventd...OK\nStarting liveproxyd...OK\nStarting mknotifyd...OK\nStarting rrdcached...OK\nStarting cmc...OK\nStarting apache...OK\nStarting dcd...OK\nStarting redis...OK\nInitializing Crontab...OK\n<\/code><\/pre>\n\n\n\n
Accessing Checkmk Web User Interface<\/h3>\n\n\n\n
http:\/\/ubuntu20\/kifarunix\/<\/code><\/strong>.<\/p>\n\n\n\n
http:\/\/192.168.59.23<\/strong>\/kifarunix\/.<\/code><\/p>\n\n\n\n
systemctl status apache2<\/code><\/pre>\n\n\n\n
systemctl enable --now apache2<\/code><\/pre>\n\n\n\n
ufw allow \"Apache Full\"<\/code><\/pre>\n\n\n\n
<\/figure><\/div>\n\n\n
omd create<\/code> command.<\/p>\n\n\n\n
The admin user for the web applications is cmkadmin with password: kFYhb3jT<\/code><\/pre>\n\n\n\n
omd su NAME-of-SITE<\/code><\/pre>\n\n\n\n
omd su kifarunix<\/code><\/pre>\n\n\n\n
htpasswd etc\/htpasswd cmkadmin<\/code><\/pre>\n\n\n\n
exit<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
Reference<\/h3>\n\n\n\n
Other Related Tutorials<\/h3>\n\n\n\n