Monitorare coda postfix

Un semplice script bash che controlla la coda di postix e ci avverte se supera un determinato limite :

 Bash |  copy code |? 
01
#!/bin/bash
02
limit=50;
03
notifyemail=luigi.molinaro@gmail.com;
04
servername=$(hostname);
05
 
06
queue_p=$(postqueue -p | grep Request | awk '{print $5}');
07
 
08
if [ $queue_p -ge $limit ] ; then
09
        echo "
10
Dear Server admin,
11
 
12
We have $limit in local mailqueue.
13
" | mail -s "Mailqueue limit exceeding - $servername" $notifyemail
14
 
15
fi
16

 

 

Lascia un Commento

L'indirizzo email non verrĂ  pubblicato. I campi obbligatori sono contrassegnati *

*

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Ricevi un avviso se ci sono nuovi commenti. Oppure iscriviti senza commentare.