Categories: Ubuntu

How to Install and Use Monit on Ubuntu 22.04

“Monit” is a Unix-based open-source process monitoring tool which allows the users to monitor different processes. This tool can monitor various system resources including memory usage, CPU usage, network connectivity, specific processes, and every service that runs in your system. Monit uses the native HTTP(S) web server or the command line to view the system’s status. Furthermore, it can also do automatic upkeep, repairs, and relevant consequential actions.

Monit has a web interface that helps you check the status of the monitored services and configure the monitoring accordingly. This tool is helpful for the server admins to ensure that the essential services are running with no issues.

Sponsored

Hence, it is good to use Monit to make your system smoother. This short guide explains the simple ways to install and use Monit on Ubuntu 22.04.

How to Install and Use Monit on Ubuntu 20.04

First, update the system to eliminate the chances of getting errors while installing Monit:

sudo apt update
sudo apt upgrade

The base repository for Ubuntu 22.04 includes Monit by default, so run the following command to install the most recent version of Monit:

sudo apt install monit

You can verify the version of Monit through the following command:

monit –version

Once you are done, enable and start the Monit service in your system:

sudo systemctl start monit
sudo systemctl enable monit
sudo systemctl status monit

Configuration Process of Monit
You can now configure Monit. Run the following command to open the configuration file in the terminal:

sudo nano /etc/monit/monitrc

After that, enter the server’s IP address or domain name and set the Monit admin account password. It is only applicable if you use a remote machine. If you only use a local host, leave it with no changes.

For example, you can take the reference from the following image to make changes in the system accordingly. We changed the admin and entered the password to configure it for the system:

Sponsored

To implement the new configuration, save and close the file. Then, restart the Monit service:

sudo monit -t
sudo systemctl restart monit

Access the Monit Web User Interface
After installing Monit and configuring the back end, you can now access the Monit service using the server’s IP address:

http://localhost:2812
http://example.com:2812
http://ip-address:2812

Use the username and password that are specified in the configuration file to log in.

Click on the system to display more in-depth statistics on the dashboard.

If you cannot access the web interface, verify that Monit is running at the correct port. You can verify it through the following command:

sudo netstat -plnt | grep monit

This command checks Monit and finds the correctly configured port. You can also check if the firewall blocked the connection of Monit:

sudo ufw status

In case the Monit port is not allowed, run the following command for it:

sudo ufw sudo ufw allow 2812/tcp

Conclusion

This tutorial is about the simple ways to install and use Monit on Ubuntu 22.04. Monit is a fantastic tool to monitor the CPU usage, memory usage, server uptime, server application services, and many more. You can monitor the system on Ubuntu using the compact M/Monit program in this manner.

Ubuntu Server Admin

Recent Posts

How to Fix VMware’s “Could not open /dev/vmmon” Error on Ubuntu

You’ve recently installed VMware Workstation on your Ubuntu system and encountered the frustrating “Could not…

7 hours ago

How to Fix Ubuntu 404 Errors While Fetching Dependencies

Have you ever found yourself staring at a terminal full of 404 errors while trying…

7 hours ago

How to Fix ‘Please Install All Available Updates’ Error When Upgrading Ubuntu 18.04 to 20.04 LTS

One particularly frustrating error that many users face when trying to upgrade from Ubuntu 18.04 …

7 hours ago

How to fix “Release is not valid yet” Error in Docker Containers

In the world of containerization, time synchronization issues can create unexpected roadblocks when working with…

7 hours ago

How to fix “Externally Managed Environment” Pip Errors on Ubuntu

If you’ve recently upgraded to Ubuntu 23.04 or newer, you might have encountered a frustrating…

7 hours ago

Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge

Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI…

14 hours ago