More system monitoring with monit for Debian

Discussion in 'Tips/Tricks/Mods' started by Hans, May 13, 2007.

  1. Hans

    Hans Moderator ISPConfig Developer

    If you've setup Monit according one of Falko's howto's:

    http://www.howtoforge.com/server_monitoring_monit_munin

    or

    http://www.howtoforge.com/server_monitoring_with_munin_monit_debian_etch you're able to use monit to monitor the following processes:

    proftpd, sshd, mysql, apache & postfix

    If you add some extra lines to your /etc/monit/monitrc you're also able to monitor: bind9, Courier pop3, Courier pop3-SSL & Courier-imap.

    Lines to be added:

    check process bind9 with pidfile /var/lib/named/var/run/bind/run/named.pid
    group bind
    start program = "/etc/init.d/bind9 start"
    stop program = "/etc/init.d/bind9 stop"
    if failed port 53 then restart
    if 5 restarts within 5 cycles then timeout

    check process pop3 with pidfile /var/run/courier/pop3d.pid
    group mail
    start program = "/etc/init.d/courier-pop start"
    stop program = "/etc/init.d/courier-pop stop"
    if failed port 110 then restart
    if 5 restarts within 5 cycles then timeout

    check process pop3-ssl with pidfile /var/run/courier/pop3d-ssl.pid
    group mail
    start program = "/etc/init.d/courier-pop-ssl start"
    stop program = "/etc/init.d/courier-pop-ssl stop"
    if failed port 995 then restart
    if 5 restarts within 5 cycles then timeout

    check process imap with pidfile /var/run/courier/imapd.pid
    group mail
    start program = "/etc/init.d/courier-imap start"
    stop program = "/etc/init.d/courier-imap stop"
    if failed port 143 then restart
    if 5 restarts within 5 cycles then timeout

    After adding these extra lines do not forget to restart monit with:
    /etc/init.d/monit restart
     
    Last edited: May 14, 2007

Share This Page