Monitoring amavisd-new with mmonit

Discussion in 'Server Operation' started by Ovidiu, Nov 2, 2016.

  1. Ovidiu

    Ovidiu Active Member

    I've seen a couple of threads and I have a lot of trouble with amavis timing out.
    At first I assumed monitoring amavis with monit would solve the problem, this way:
    Code:
    check process amavisd with pidfile /var/run/amavis/amavisd.pid
    group mail
    start program = "/usr/sbin/service amavis start"
    stop program = "/usr/sbin/service amavis stop"
    if failed port 10024 protocol smtp then exec /root/restart_mailserver.sh
    if failed port 10026 protocol smtp then exec /root/restart_mailserver.sh
    if 5 restarts within 25 cycles then timeout
    only to realize that would only help if amavis crashed or stopped but not in case amavis's connection to mysql timed out somehow.

    I am seeing errors like this:
    Code:
    Nov 01 22:39:02 alfred postfix/lmtp:  8CB4252080F: to=<ovidiu@mydomain.tld>, relay=127.0.0.1[127.0.0.1]:10026, delay=2617, delays=2317/0/300/0, dsn=4.4.2, status=deferred (conversation with 127.0.0.1[127.0.0.1] timed out while receiving the initial server greeting)
    which would not be caught by the above monit check as the SMTP connection to amavis succeeds, the problem is that amavis does not answer with an OK but with a deferred status :-(

    Any ideas? All I can see working now is periodically check my postfix queue and if it is bigger than X then restart amavis and flush the queue :-(
     

Share This Page