4. monit 進階

最後更新: 2024-04-18

目錄

  • Dependencies
  • GROUP

 


Dependencies

 

DEPENDS on service[, service [,...]]

check file apache_bin with path /usr/local/apache/bin/httpd
  # since the apache process entry depends on the httpd entry this entry will also execute the unmonitor action
  if failed checksum and
     expect the sum 8f7f419955cefa0b33a2ba316cba3659 then unmonitor
  if failed permission 755 then unmonitor
  if failed uid root then unmonitor
  if failed gid root then unmonitor
  alert [email protected] on {
         checksum, permission, uid, gid, unmonitor
      } with the mail-format { subject: Alarm! }
  group server

check process apache with pidfile /usr/local/apache/logs/httpd.pid
  .......................
  depends on apache_bin
  group server

if a service is started, it will first stop any services that depends on itself and after it is started, start all depending services again.

 


GROUP [未完]

 

Group 的 Config

check ....
  ....
  group server

check ....
  ....
  group server

Start / Stop 一 Group

monit -g <groupname> start

monit -g <groupname> stop

 

Creative Commons license icon Creative Commons license icon