|
From: | Fabien Morcamp |
Subject: | Re: Monit and mailq size |
Date: | Thu, 29 Jan 2015 18:00:30 +0100 |
FabienThanks a lot for your helps and ideas.Somebody already have to do that ?If not, do you see a better process to do that ?I think this is going to works but I would like to know if it can possible to do the same thing whithout call an external script ?And if bigger than 200, clear the mailq.If between 100 and 200, send an alert.If the number of sending mail in mailq is less than 100, nothing to do.The script is here (postfix_queue.sh):Hello all,I'm back to you for a question about Monit.
I want to monit the mailq size and for that, I wrote a script and a monit plugins.#!/bin/bash postfix_queue=`postqueue -p | grep Requests | awk {'print $5'}` if [ "$postfix_queue" \< "100" ] then exit 0 elif [ "$postfix_queue" \>= "100" and \<= "200"] exit 1 else exit 2 fiAnd the monit plugin is:The goal is to monitoring the mailq size.
check program postfix_queue with path /root/postfix_queue.sh every "0 1 * * *" group mail if status == 1 then alert if status == 2 then exec "/usr/sbin/postsuper -d"
[Prev in Thread] | Current Thread | [Next in Thread] |