For those who don’t know about Monit, is an open-source utility for managing and monitoring Linux systems, including Ubuntu. It can automate, maintain and repair Linux services, including restoring and restarting them. A complete enterprise-grade server and log monitoring system. This post will show you how to perform a basic configuration after installation. You’ll also be able to log on to the Monit server once installed. For more about Monit, please visit its homepage. When you’re ready, continue below with the steps:

Install Monit Package

To install Monit, simply run the commands below on the Ubuntu server. Most Linux distributions include Monit. Please consult with your package manager. You may also want to check that they have a recent Monit version. After installing Monit, the commands below can be used to stop, start and enable the Monit service.

Configure Monit Service

Monit configuration files are located under /etc/monit/ directory. The main configuration file is /etc/monit/monitrc and has a basic setup configured in it. You’ll need to make some changes to suit your environment. By default, all files located on /etc/monit/conf.d/ and /etc/monit/conf-enabled/ are read by monit when the service is started.  Use the /etc/monit/conf.d/ directory to put all your monitoring configuration files in it. You can have as many files as you want. or group each service into a single file. Open Monit main config file and make the highlighted changes below, then save the file. The highlighted changes will allow HTTP access to the Monit web interface. With the settings above, you should be able to login to the Monit server via the localhost name or IP and username: admin, password: monit Save your changes and exit. Restart the Monit service by running the commands below:

Access Monit Web Portal

Now that the Monit server is installed and access is allowed from the local machine, use the address below to access the Monit portal. with username: admin and password monit as defined in the configuration file above. By default, not much is being monitored by Monit. you can add custom services to be monitored by creating them in the /etc/monit/conf.d/ directory. For example, to monitor the Apache2 service, create a custom config file called apache2.conf in the /etc/monit/conf.d/ directory. Then add the lines below: Save the file and run the commands below to Monit to monitor Apache2. Check this page for Monit examples of how to configure custom configurations.  https://mmonit.com/wiki/Monit/ConfigurationExamples#apache Now you should see the Apache2 service initializing/running in the portal online. That’s it! You may also like the post below: