linux monit deployment process monitoring service

Copyright Notice: Copyright © 2018-2019 cool white open no ice Copyright https://blog.csdn.net/qq_21082615/article/details/91429475

Description: Monit is an open source monitoring and management tools (similar to the supervisor), can monitor the system load linux, files, processes, and so on. When the system load is too high, monitor file has been tampered with, the process of abnormal exit, it is possible to send alarm messages, and the ability to enable or disable the automatic abnormal process. Monit embedded web interface, you can see Monitoring item status on the current host

First, the deployment of M / Monit centralized management

1.下载文件
cd /usr/local/src/
wget https://mmonit.com/dist/mmonit-3.7.2-linux-x64.tar.gz

2.解压文件
tar -zxvf mmonit-3.7.2-linux-x64.tar.gz

3.修改配置
如果需要修改数据源,需要修改一下文件
vi /usr/local/src/mmonit-3.7.2/conf/server.xml
默认是使用sqlite3
<Realm url="sqlite:///db/mmonit.db?synchronous=normal&heap_limit=8000&foreign_keys=on&journal_mode=wal"
                  minConnections="5"
                  maxConnections="25"
                  reapConnections="300" />
也可以改成mysql和postgresql数据库.以myqsl为例(使用默认的sqlite可以跳过):
修改sqlite配置为
<Realm url="mysql://mmonit:[email protected]/mmonit"
                  minConnections="5"
                  maxConnections="25"
                  reapConnections="300" />

4.启动服务
bin/mmonit -c conf/server.xml

5.访问
访问 IP地址:8080
默认用户名
user   admin 
password    swordfish 

Second, the deployment monit monitor

1、下载监控
cd /usr/local/src
wget https://mmonit.com/monit/dist/binary/5.9/monit-5.9-linux-x64.tar.gz

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

2.修改监控配置
  开启远程访问
  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

  开启将数据发送到集中管理服务器
  set mmonit http://monit:monit@集中管理服务器ip:8080/collector

  配置监听文件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.启动服务
bin/monit -c conf/monitrc

4.访问集中监控平台
IP:8080

Third, after a successful visit to page

Here Insert Picture Description
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/qq_21082615/article/details/91429475