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:
    check process amavisd with pidfile /var/run/amavis/
    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/
    if failed port 10026 protocol smtp then exec /root/
    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:
    Nov 01 22:39:02 alfred postfix/lmtp:  8CB4252080F: to=<[email protected]>, relay=[]:10026, delay=2617, delays=2317/0/300/0, dsn=4.4.2, status=deferred (conversation with[] 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