Monit

от ILuxWiki

Направо към: навигация, търсене

Съдържание

готови конфигурации

diskfree / filesystem

 check filesystem rootfs with path /dev/cciss/c0d0p5
   if space usage > 80% for 5 times within 15 cycles then alert
   if space usage > 99% then stop
   if inode usage > 200000 then alert
   if inode usage > 99% then stop
   group server
 check filesystem srvfs with path /dev/cciss/c0d0p7
   if space usage > 80% for 5 times within 15 cycles then alert
   if space usage > 99% then stop
   group server
 
 check filesystem root with path /dev/sda5
       if space usage > 80% then alert
       group server
 
 check filesystem srv with path /dev/sda7
       if space usage > 80% then alert
       group server
 
 check filesystem home with path /dev/sda6
       if space usage > 80% then alert
       group server

apache

 check process apache with pidfile /var/run/apache2.pid
       start program = "/etc/init.d/apache2 start" with timeout 60 seconds
       stop program  = "/etc/init.d/apache2 stop"
       if totalmem > 1000 Mb then alert
       if children > 255 for 5 cycles then stop
       if cpu usage > 95% for 3 cycles then restart
       if failed port 80 protocol http then restart
       if 5 restarts within 5 cycles then timeout
       group server

backup

 check file backup with path /backup/.backup.mounted
    start program = "/sbin/mount.nfs  192.168.101.250:/mnt/HD_a2/nfs /backup -o soft,intr,timeo=30"
    stop program =  "/bin/umount -f /backup"
    group server
 
 check host backupsrv with address 192.168.101.250
   if failed icmp type echo count 3 with timeout 3 seconds then alert

mysql

 check process mysql with pidfile /srv/db/mysql/drt-server.pid
   group database
   start program = "/usr/sbin/service mysql start"
   stop program = "/usr/sbin/service mysql stop"
   if failed host 127.0.0.1 port 3306 then restart
   if 5 restarts within 5 cycles then timeout

ssh

 check process sshd with pidfile /var/run/sshd.pid
   start program "/etc/init.d/ssh start"
   stop program "/etc/init.d/ssh stop"
   if failed port 22 protocol ssh then restart
   if 5 restarts within 5 cycles then timeout

tomcat

 check process tomcat with pidfile /var/run/tomcat6.pid
       start program = "/etc/init.d/tomcat6 start"
       stop program  = "/etc/init.d/tomcat6 stop"
       if cpu > 60% for 2 cycles then alert
       if cpu > 80% for 5 cycles then restart
       if totalmem > 2500.0 MB for 5 cycles then restart
       if failed host 127.0.0.1 port 8005 then alert
       if failed host 127.0.0.1 port 8080 then alert
       if 5 restarts within 5 cycles then timeout