File: sendmail_mailqueue.in

package info (click to toggle)
munin 1.2.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,940 kB
  • ctags: 98
  • sloc: sh: 4,215; makefile: 452; perl: 135
file content (63 lines) | stat: -rwxr-xr-x 1,537 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
#
# Plugin to monitor sendmail queue size.
#
# Usage: Place in /etc/lrrd/client.d/ (or link it there  using ln -s)
#
# Parameters understood:
#
# 	config   (required)
# 	autoconf (optional)
#
# Config variables:
#
#       mspqueue     - MSQ queue directory
#       mtaqueue     - MTA queue directory
#
# $Log$
# Revision 1.5.2.1  2005/02/16 19:05:40  jimmyo
# generic/sendmail_mailqueue handles bigger queues (fix by Mickey Everts).
#
# Revision 1.5  2004/11/20 19:31:59  jimmyo
# Fixed bug in generic/sendmail_mailqueue, when queue is empty.
#
# Revision 1.4  2004/05/20 19:02:36  jimmyo
# Set categories on a bunch of plugins
#
# Revision 1.3  2004/05/14 21:16:46  jimmyo
# "Upped" som plugins from contrib/manual to auto.
#
# Revision 1.2  2004/02/18 18:40:02  jimmyo
# Added Log:
#
#%# family=auto
#%# capabilities=autoconf

MSP_QUEUE=/var/spool/mqueue-client
MTA_QUEUE=/var/spool/mqueue
if [ "$mspqueue"  ]; then MSP_QUEUE=$mspqueue ; fi
if [ "$mtaqueue"  ]; then MTA_QUEUE=$mspqueue ; fi

if [ "$1" = "autoconf" ]; then
	if [ -d ${MSP_QUEUE} -a -d ${MTA_QUEUE} ] ; then
		echo yes
		exit 0
	else
		echo no
		exit 1
	fi
fi

if [ "$1" = "config" ]; then

	echo 'graph_title Sendmail queued mails'
	echo 'graph_order mails'
	echo 'graph_vlabel mails in queue'
	echo 'graph_category sendmail'
	echo 'mails.label mails'
	exit 0
fi

mspmails=`find ${MSP_QUEUE} -type f -name '[qQ]*' 2>/dev/null | wc -l`
mtamails=`find ${MTA_QUEUE} -type f -name '[qQ]*' 2>/dev/null | wc -l`
echo "mails.value `expr ${mspmails} + ${mtamails}`"