Code Snippet

Just another Code Snippet site

Monit


8 thoughts on “Monit

  • Olivier says:
    rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    yum install monit -y
    service monit start
    chkconfig monit on
    
  • Olivier says:

    Set mail server

    SET MAILSERVER my_mail_server
       username "USERNAME" password "PASSWOR"
    
    SET alert MAIL_RECIPIENT_ADDRESS
    

    For gmail : https://mmonit.com/wiki/Monit/Gmail

  • Olivier says:
    #Artifactory
    
    check process artifactory
      with pidfile /opt/app/artifactory/artifactory/run/artifactory.pid
      start program "/etc/init.d/artifactory start" with timeout 210 seconds
      stop program "/etc/init.d/artifactory stop" with timeout 120 seconds
      if failed url http://localhost/artifactory/api/system/ping for 3 cycles then restart
    
  • Olivier says:
    # Jenkins
    check process jenkins
      with pidfile /var/run/jenkins.pid
      start program "/etc/init.d/jenkins start" with timeout 210 seconds
      stop program "/etc/init.d/jenkins stop" with timeout 120 seconds
      if failed url http://localhost/jenkins/ for 3 cycles then restart
    
  • Olivier says:

    # Httpd

      check process httpd
        with pidfile /var/run/httpd/httpd.pid
        start program "/etc/init.d/httpd start" with timeout 210 seconds
        stop program "/etc/init.d/httpd stop" with timeout 120 seconds
        if failed url http://localhost/error/noindex.html for 3 cycles then restart
        group server
    
    
  • Olivier says:

    # HDD

      check filesystem opt with path /opt
        if space usage > 80% for 5 times within 15 cycles then alert
        if space usage > 90% then alert
    
  • Olivier says:

    # System

      check system $HOST
        if loadavg (1min) > 4 then alert
        if loadavg (5min) > 2 then alert
        if cpu usage > 95% for 5 cycles then alert
        if memory usage > 80% for 5 cycles then alert
    #    if swap usage > 25% then alert
    

Leave a Reply to Olivier Cancel reply

Your email address will not be published. Required fields are marked *