On Fri, Oct 1, 2010 at 10:42 PM, Eric Shubert <e...@shubes.net> wrote:
> Natalio Gatti wrote: > >> Here is a small script that monitors queue size and send an email in case >> it grows over certain limit: >> ********************** >> #/bin/sh >> email=m...@domain >> Max_Size=15 >> cola=`tail -50 /var/log/qmail/send/current | grep status | tail -1 | cut >> -d ' ' -f 6 | cut -d '/' -f 1` >> if test $cola -gt $Max_Size >> then >> /opt/qmailtoaster-plus/bin/qmqtool -l > /tmp/cola_saliente >> cat /tmp/cola_saliente | mail -s"COLA SALIENTE CON $cola MENSAJES" $Email >> fi >> ********************** >> >> I'm using it in 2 servers and it permits to detect when an abused account >> is used to send spam. >> Hope it helps. >> Salutti, >> >> Natalio. >> >> > That's nice, Natalio. However, what it appears that you're using to trigger > the message is the number of messages being sent at once. Wouldn't it be > simpler to use the "qmailctl queue" command (instead of the send log) to > determine exactly how many messages are in the queue? I think that would > give a more meaningful reading. > > Yes Eric, I'm monitoring the number of mails beeing sent at once. I thought that it was the easiest way. I really didn't analyze it very much. If you think that controlling the queue size is a better way, I can modify the script. > I do like it though. Perhaps we can work this into QTP somehow, at least > for the short term. > > No problem if you want to add it to QTP. > > Natalio.