Thursday, 28th March 2024

Comment posted Monitoring and restart server services (Apache, Mysql, Bind) with Monit to prevent server downtimes by .

Recent comments by

Share this on:

Tags: , ,

No Responses to “…”

  1. admin says:
    Epiphany 2.29.92 Epiphany 2.29.92 Debian GNU/Linux x64 Debian GNU/Linux x64
    Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Debian/squeeze/sid () Epiphany/2.29.92

    I have to say that the /etc/monit/monitrc configuration for apache is configured in a way that a request is made each time to /monit/token and if Apache is not responding it is predetermined to restart Apache. This kind of check could prevent many oddities when your Apache will be able to bind a TCP socket but won’t return any content to the client.

    View CommentView Comment
  2. Osi Port Numbers says:
    Firefox 3.8 Firefox 3.8 Ubuntu 9.25 Ubuntu 9.25
    Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8

    I am changing vocations and would like to be a Network Administrator of some variety. I have a knight bachelor degree, non IT, I was wondering the best route to take to take Some kind of Certification course, or is a degree program necessary? Thank all the best all the best.

    View CommentView Comment
  3. Backgammon Doubling says:
    Firefox 3.5.3 Firefox 3.5.3 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    excelenta enticos de centinso y pladeis con ssemo froglo. umpra a aramoss y amombralo onicalt con cotos tameria!

    View CommentView Comment
  4. admin says:
    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

    monit rulz 🙂

    View CommentView Comment
  5. admin says:
    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

    One little note to make here:

    /var/run/apache2.pid
    The monit rc config as explainedf in step 3 is configured to monitor (alert and restart) BIND (Named) DNS resolver server

    If wherever you configure monit you have no don’t use bind, comment inside my sample monitrc:


    check process named with pidfile /var/run/bind/run/named.pid
    start program = "/etc/init.d/bind9 start"
    stop program = "/etc/init.d/bind9 stop"
    if failed host 127.0.0.1 port 53 type tcp protocol dns then restart
    if failed host 127.0.0.1 port 53 type udp protocol dns then restart
    if 5 restarts within 5 cycles then timeout


    ##check process named with pidfile /var/run/bind/run/named.pid
    ## start program = "/etc/init.d/bind9 start"
    ## stop program = "/etc/init.d/bind9 stop"
    ## if failed host 127.0.0.1 port 53 type tcp protocol dns then restart
    ## if failed host 127.0.0.1 port 53 type udp protocol dns then
    restart
    ## if 5 restarts within 5 cycles then timeout

    View CommentView Comment
  6. admin says:
    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

    Also as I just installed monit service on one host with Debian Squeeze I can confirm. Config is working fine with Debian Squeeze shipped monit version:

    pcfreak:~# dpkg -l |grep ‘^ii monit’
    ii monit 1:5.1.1-1 A utility for monitoring and managing daemons or similar programs

    View CommentView Comment
  7. admin says:
    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

    Also i’ve figured out later. This alerts as I configured in this article might be sometimes really annoying if you receive e-mails every few seconds. Hence it might be good idea to comment alerts in my monitrc sample conf:

    To do so, remove or comment lines in Apache and MySQL monit config section:


    ## if cpu usage is greater than 80 percent for 3 cycles then alert


    ## if cpu is greater than 50% for 2 cycles then alert

    View CommentView Comment
  8. admin says:
    Firefox 3.6.3 Firefox 3.6.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

    Also the monitrc config from my article is configured to check and report for “disk full” and low disk space on /dev/md0 which used to be a software mirror type RAID1. Therefore config in monitrc reads:


    check device disk1 with path /dev/md0

    On other non-RAIDed disks, usually the disk to monitor is /dev/sda1 or /dev/sdb1

    Thus if you’re not using a hardware or software mirror probably this config section should be substituted with:
    check device disk1 with path /dev/sda1, i.e.:


    check device disk1 with path /dev/sda1

    View CommentView Comment
  9. admin says:
    Firefox 30.0 Firefox 30.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0

    If you have more than one server that you need to monitor, then you can use M/Monit– an extended version of Monit that provides a simple way to monitor multiple machines.

    View CommentView Comment