Article directory
This tutorial focuses on:
How toCentOS 7 running on the serverVestaCPpanel mountedMonit monitoringprogram?
CentOS 7 system VestaCP panel, how to set Monit configuration?
What is Monit?
Monit is a small open source tool for managing and monitoring Unix systems.
Monit will monitor the specified service process if it is automatically shut down, it will automatically restart, and it can send email notifications in case of errors.
If you are on CentOS 7, run VestaCP as your panel and you have Monit installed to monitor your server processes such as: Nginx, Apache, MariaDB and others.
Enable EPEL repository
RHEL/CentOS 7 64-bit:
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm
RHEL/CentOS 6 32-bit:
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm
- CentOS 7 does not support 32-bit EPEL repositories, so use RHEL/CentOS 6 32-bit.
Install Monit on CentOS 7
yum update yum install -y libcrypto.so.6 libssl.so.6 yum install monit
Enable port 2812 on VestaCP
Once you have successfully installed Monit monitoring, you need to set up the daemon, enable ports, IP addresses and other settings.
Step 1:Login to your VestaCP
Step 2:Enter the firewall.
- Click "Firewall" above the navigation.
Step 3:Click the + button.
- When you hover over the + button, you'll see the button change to "Add Rule".
Step 4:Add rules.
Use the following as rule settings ▼
- Action: Accept
- Protocol: TCP
- Port: 2812
- IP address: 0.0.0.0/0
- Remarks (optional): MONIT
Below is a screenshot of Vesta firewall settings ▼
Step 5:Edit the Monit configuration file
Once Monit is installed, you need to edit the main configuration file and set your own username and password.
The following is a configuration tutorial for monitoring and restarting various Vesta Panel processes on CentOS 7 ▼
Previously, Chen Weiliang’s blog shared a tutorial on installing and configuring Monit on CentOS 6 ▼
However, the configuration of the Monit monitoring program in CentOS 7 is somewhat different from that in CentOS 6, and it is not exactly the same.If you……After creating the required configuration files, test for syntax errors ▼
monit -t
Start monit by simply typing:
monit
Start the Monit service at boot ▼
systemctl enable monit.service
Monit Notes
Monit monitors process services, which means that services monitored by Monit cannot be stopped using normal methods, because once stopped, Monit will start them again.
To stop a service monitored by Monit, you should use something likemonit stop name
Such a command, for example to stop nginx ▼
monit stop nginx
To stop all services monitored by Monit▼
monit stop all
To start a service you can usemonit start name
such a command ▼
monit start nginx
Start all services monitored by Monit ▼
monit start all
Uninstall Monit monitoring program ▼
yum remove monit
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "How to install the Monit monitoring program on the VestaCP panel of the CentOS 7 system? , to help you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-731.html
Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!