Introduction to linux process monitoring service monit

table of Contents

1. Deploy M/Monit centralized management

2. Deploy monit monitoring

Third, the page after a successful visit


Monit is an open source monitoring and management tool (similar to supervisor) that can monitor the load, files, processes, etc. of the Linux system. When the system load is too high, the monitoring file is tampered with, or the process exits abnormally, it can send an email alert, and can automatically start or shut down the abnormal process. Monit has a built-in web interface, which can see the status of monitoring items on the current host

1. Deploy M/Monit centralized management

1. Download the file

cd /usr/local/src/
wget https://mmonit.com/dist/mmonit-3.7.2-linux-x64.tar.gz

2. Unzip the file

tar -zxvf mmonit-3.7.2-linux-x64.tar.gz

3. Modify the configuration
If you need to modify the data source, you need to modify the file

vi /usr/local/src/mmonit-3.7.2/conf/server.xml

The default is to use sqlite3

<Realm url="sqlite:///db/mmonit.db?synchronous=normal&heap_limit=8000&foreign_keys=on&journal_mode=wal"
                  minConnections="5"
                  maxConnections="25"
                  reapConnections="300" />

It can also be changed to mysql and postgresql databases. Take myqsl as an example (using the default sqlite can be skipped):
modify the sqlite configuration to

<Realm url="mysql://mmonit:[email protected]/mmonit"
                  minConnections="5"
                  maxConnections="25"
                  reapConnections="300" />

4. Start the service

bin/mmonit -c conf/server.xml

5. Access
Access IP address: 8080
default user name
user admin 
password swordfish 


2. Deploy monit monitoring

1. Download monitoring

cd /usr/local/src
wget https://mmonit.com/monit/dist/binary/5.9/monit-5.9-linux-x64.tar.gz

Unzip

tar -zxvf monit-5.9-linux-x64.tar.gz

2. Modify the monitoring configuration to
  enable remote access

  set httpd port 2812 and
  use address 192.168.0.123  # only accept connection from localhost
  allow 0.0.0.0/0        # allow localhost to connect to the server and
  allow admin:monit      # require user 'admin' with password 'monit'
  allow @monit           # allow users of group 'monit' to connect (rw)
  allow @users readonly  # allow users of group 'users' to connect readonly

  Turn on sending data to the centralized management server

  set mmonit http://monit:monit@集中管理服务器ip:8080/collector

  Configure listening file pid

  check process tomcat_test with pidfile /data/www/test/bin/tomcat.pid
     start program = "/data/www/test/bin/startup.sh"
     stop program  = "/data/www/test/bin/shutdown.sh"

3. Start the service

bin/monit -c conf/monitrc

4. Access to the centralized monitoring platform
IP: 8080

Third, the page after a successful visit

Insert picture description here

Insert picture description here

 

 

Guess you like

Origin blog.csdn.net/whatday/article/details/114519415
Recommended