{"id":7862,"date":"2021-07-10T12:02:11","date_gmt":"2021-07-10T12:02:11","guid":{"rendered":"https:\/\/linuxways.net\/?p=7862"},"modified":"2021-07-10T12:02:11","modified_gmt":"2021-07-10T12:02:11","slug":"how-to-install-and-configure-monit-monitoring-server-on-ubuntu-20-04-lts","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-and-configure-monit-monitoring-server-on-ubuntu-20-04-lts\/","title":{"rendered":"How to Install and Configure Monit Monitoring Server on Ubuntu 20.04 LTS"},"content":{"rendered":"<p>Monit is a lightweight and effective tool that is used for monitoring system services. Using the Monit web interface, you can easily monitor processes and system resources such as Memory, CPU usage, load average, server uptime, network connections, and different server applications. It is originally used as a single server. However, the commercial version of the Monit server can monitor multiple servers at the same time through just one web interface.<\/p>\n<p>We will talk about the installation of the Monit monitoring server on the Ubuntu 20.04 system through the command line method in this article.<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<p>Users must have sudo privileges or log in as root users on your system for the installation of Monit.<\/p>\n<h2><strong>Installation and configuration of Monit on Ubuntu 20.04 <\/strong><\/h2>\n<p>The following steps need to perform for the installation and configuration of the Monit monitoring server on your Ubuntu 20.04 system:<\/p>\n<h3><strong>Step 1: Install of Monit Monitoring server on Ubuntu 20.04<\/strong><\/h3>\n<p>Open the \u2018Terminal\u2019 application on your system by pressing \u2018Ctrl+Alt+t\u2019. The Monit application can be directly installed from Ubuntu\u2019s official repository. However, use the following command for the installation of the Monit server:<\/p>\n<pre>$ sudo apt install monit<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1090\" height=\"797\" class=\"wp-image-7863\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-8.png 1090w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-8-300x219.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-8-1024x749.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-8-768x562.png 768w\" sizes=\"auto, (max-width: 1090px) 100vw, 1090px\" \/><\/p>\n<p>After completing the installation of the Monit server, use the below-given command to check the monit services are running or not :<\/p>\n<pre>$ sudo systemctl status monit<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1086\" height=\"416\" class=\"wp-image-7864\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-9.png 1086w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-9-300x115.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-9-1024x392.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-9-768x294.png 768w\" sizes=\"auto, (max-width: 1086px) 100vw, 1086px\" \/><\/p>\n<h3><strong>Step 2: Monit Server Configurations<\/strong><\/h3>\n<p>The default configuration file of Monit is available at the \u2018\/etc\/monit\/monitrc\u2019 location. Monit offers a web interface to monitor the services through the web browser. The monit web interface is not enabled by default. But, it can be enabled by changing few lines in the configuration file by using the below-mentioned command:<\/p>\n<pre>$ sudo nano \/etc\/monit\/monitrc<\/pre>\n<p>Search the below-mentioned lines in the configuration file and uncomment these lines:<\/p>\n<pre><strong>set httpd port 2812 and<\/strong><\/pre>\n<pre><strong>allow admin:monit\u00a0\u00a0<\/strong><\/pre>\n<p>Here, the admin password is \u2018monit\u2019. Save the edited configurations and press \u2018Ctrl+x\u2019 to exit from the configuration.<\/p>\n<h3><strong>Step 3: Check Syntax errors<\/strong><\/h3>\n<p>In this step, you will check that the configuration file is without any syntax errors by running the following command:<\/p>\n<pre>$ sudo monit -t<\/pre>\n<p>The following output should print on the terminal window:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1071\" height=\"99\" class=\"wp-image-7865\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-10.png 1071w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-10-300x28.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-10-1024x95.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-10-768x71.png 768w\" sizes=\"auto, (max-width: 1071px) 100vw, 1071px\" \/><\/p>\n<h3><strong>Step 4: Enable Monit services<\/strong><\/h3>\n<p>If Monit service is not enabled then, use the following command to enable it automatically on system boot:<\/p>\n<pre>$ sudo \/lib\/systemd\/systemd-sysv-install enable monit<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"57\" class=\"wp-image-7866\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-11.png 1080w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-11-300x16.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-11-1024x54.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-11-768x41.png 768w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/p>\n<p>Now, restart or reload the services of Monit by using the below-given command:<\/p>\n<pre>$ sudo systemctl restart monit<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1060\" height=\"81\" class=\"wp-image-7867\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-12.png 1060w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-12-300x23.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-12-1024x78.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-12-768x59.png 768w\" sizes=\"auto, (max-width: 1060px) 100vw, 1060px\" \/><\/p>\n<pre>$ sudo monit reload<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1028\" height=\"89\" class=\"wp-image-7868\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-13.png 1028w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-13-300x26.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-13-1024x89.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-13-768x66.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-13-1020x89.png 1020w\" sizes=\"auto, (max-width: 1028px) 100vw, 1028px\" \/><\/p>\n<p>To verify that port 2812 is listening or not, use the below-given command:<\/p>\n<pre>$ ss -plunt | grep 2812<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1067\" height=\"221\" class=\"wp-image-7869\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-14.png 1067w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-14-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-14-1024x212.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-14-768x159.png 768w\" sizes=\"auto, (max-width: 1067px) 100vw, 1067px\" \/><\/p>\n<h3><strong>Step 5: Check Monit Status<\/strong><\/h3>\n<p>To verify that everything is working good, use the following command:<\/p>\n<pre>$ sudo monit status<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1071\" height=\"465\" class=\"wp-image-7870\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-15.png 1071w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-15-300x130.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-15-1024x445.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-15-768x333.png 768w\" sizes=\"auto, (max-width: 1071px) 100vw, 1071px\" \/><\/p>\n<h3><strong>Step 6: Allow Firewall access to the port<\/strong><\/h3>\n<p>If you want to access the Monit web interface from the outside to your localhost then, use the following command to allow access to public users:<\/p>\n<pre>$ sudo ufw allow 2812<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"873\" height=\"123\" class=\"wp-image-7871\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-16.png 873w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-16-300x42.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-16-768x108.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/p>\n<h3><strong>Step 7: Access the Monit web interface<\/strong><\/h3>\n<p>Access the web interface of the Monit server through the web browser. Enter the IP address of the server or machine where the Monit is installed as follows:<\/p>\n<pre>http:\/\/your-server-ip-address:2812<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1100\" height=\"751\" class=\"wp-image-7872\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-17.png 1100w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-17-300x205.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-17-1024x699.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-17-768x524.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>The dialogue box will pop up on your browser. Enter the username and password. After that, the following web interface displays on your system\u2019s browser:<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>We have installed the Monit monitoring server on the Ubuntu 20.04 system in this article. You can easily monitor your system using this lightweight tool.<\/p>","protected":false},"excerpt":{"rendered":"<p>Monit is a lightweight and effective tool that is used for monitoring system services. Using the Monit web interface, you can easily monitor processes and system resources such&hellip;<\/p>","protected":false},"author":1,"featured_media":8240,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[398,100],"class_list":["post-7862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-monit-monitoring-server","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7862","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=7862"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7862\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/8240"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=7862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=7862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=7862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}