On Fri, 16 Dec 2011 11:46:08 +0000 [email protected] wrote:
> On 16/12/11 09:45, John Burnham wrote:
> 
> >> I need a script, or help doing one.
> >> 
> >> I need a script that sends me an email when qeue is bigger than 2.500
> >> emails.
> >> 
> >> Can anyone help me ?
> >> 
> > 
> > Totally untested and before I've finished my coffee, but here's some pseudo 
> > code
> > 
> > #!/bin/bash
> > 
> > MSGNO=$(/path/to/exiqgrep -b * | wc -l)
> > 
> > if [ $MSGNO -gt 2500 ]; then
> > 
> > do some stuff like sending mail
> > 
> > fi
> 
> Rather than writing a script, you could just stick this in a cron job:
> 
> if [ `exiqgrep -c|awk {'print $1'}` -gt 2500 ]; then echo "Large Mail
> Queue"|mail -s "The Subject" [email protected]; fi

if [ `exim -bpc` -gt 2500 ]; then ...


--Frank Elsner

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to