Menu

#96 queue_postfix

open
nobody
None
5
2005-03-29
2005-03-29
OSGPCQ
No

Give the number of mail and the size of a queue , about
a postfix queue.

Le programme: /usr/local/bin/statpostfix
#!/bin/bash
# Affichage des statistiques par interface
reseau
#
# 20031122 par OSG : Vincent Tamet //
osg@free.fr
# https://osgpcq.no-ip.com/osg
RESULT=`/usr/sbin/postqueue -p
| /usr/bin/tail -1 | /bin/grep -v "Mail queue is empty"`
if test "$RESULT" = ""
then
TAILLEMAIL=0
NBMAIL=0
else
TAILLEMAIL=`echo $RESULT |
awk {'print $2;'}`
NBMAIL=`echo $RESULT | awk
{'print $5;'}`
fi
echo $TAILLEMAIL
echo $NBMAIL

Le fichier: /etc/cricket/config/software/postfix-
queue/Defaults
Target --default--
target-type = postfixqueue
directory-desc = "Affiche le nombre de
mail dans la queue et la taille de celle-ci."

# Datasource Definitions

datasource TailleQueue
ds-source =
exec:0:"/usr/local/bin/statpostfix"
rrd-ds-type = GAUGE
desc = "Taille"

datasource NbQueue
ds-source =
exec:1:"/usr/local/bin/statpostfix"
rrd-ds-type = GAUGE
desc = "Nombre"

# Target Type Definitions

targetType postfixqueue
ds = "TailleQueue, NbQueue"
view = "queue: TailleQueue NbQueue"

# Graph Definitions

graph TailleQueue
color = dark-green
draw-as = AREA
y-axis = "Taille"
units = "Kbytes"
legend = "Taille"
precision = 0

graph NbQueue
color = blue
draw-as = LINE1
y-axis = "Nombre"
units = "Nombre"
legend = "Nombre"
precision = 0

Le fichier: /etc/cricket/config/software/postfix-
queue/Targets
target laqueuepostfix
short-desc = "Queue de
postfix"

Discussion


Log in to post a comment.