3 # Plugin to monitor exim queue size
5 # Usage: Copy or link into /etc/munin/node.d/
10 # autoconf (optional - used by munin-config)
14 # spooldir - Override what exim says
15 # exim - Where's exim?
16 # queuewarn - When to warn
17 # queuecrit - When to crit
20 # Revision 1.4 2004/11/10 15:47:10 jimmyo
21 # Made graph_title a parameter for generic/exim_mailqueue (patch by Torstein T. Svendsen, SF#1060834).
23 # Revision 1.3 2004/05/20 13:57:12 jimmyo
24 # Set categories to some of the plugins.
26 # Revision 1.2 2004/01/29 19:39:00 jimmyo
27 # Generic plugins now use printf instead of echo -n, as this is more portable (SF#885564)
29 # Revision 1.1 2004/01/02 18:50:00 jimmyo
30 # Renamed occurrances of lrrd -> munin
32 # Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
33 # Import of LRRD CVS tree after renaming to Munin
35 # Revision 1.5 2003/11/07 17:43:16 jimmyo
36 # Cleanups and log entries
40 # Magic markers (optional - used by installation scripts and
44 #%# capabilities=autoconf
47 SPOOLDIR='/var/spool/exim'
48 #EXIM=`which exim 2>/dev/null || which exim4 2>/dev/null`
49 EXIM='/usr/exim/bin/exim'
52 GRAPHTITLE='Exim Mailqueue'
54 if [ "$spooldir" ]; then SPOOLDIR=$spooldir ; fi
55 if [ "$exim" ]; then EXIM=$exim ; fi
56 if [ "$queuewarn" ]; then QUEUEWARN=$queuewarn; fi
57 if [ "$queuecrit" ]; then QUEUECRIT=$queuecrit; fi
58 if [ "$graphtitle" ]; then GRAPHTITLE=$graphtitle; fi
60 if [ "$SPOOLDIR" = "unset" ]
62 SPOOLDIR=`($EXIM -bP spool_directory | awk '{ print $3 "/input" }') 2>/dev/null`
65 if [ "$1" = "autoconf" ]; then
66 if ( $EXIM -bV 2>/dev/null >/dev/null ); then
67 if ( /usr/bin/find $SPOOLDIR -iname "*-H" -print 2>/dev/null >/dev/null ); then
72 echo "no (permission denied on spooldir)"
82 echo "no (exim not found)"
91 if [ "$1" = "config" ]; then
92 if [ ! -z $SPOOLDIR ];then
93 echo "graph_title $GRAPHTITLE"
94 echo 'graph_args --base 1000 -l 0'
95 echo 'graph_vlabel mails in queue'
96 echo 'graph_category Mail'
97 echo 'mails.label mails'
98 echo 'mails.draw AREA'
99 echo "mails.warning $QUEUEWARN"
100 echo "mails.critical $QUEUECRIT"
105 printf "mails.value "
106 /usr/bin/find $SPOOLDIR -iname "*-H" -print 2>/dev/null |wc -l | sed 's/ *//'