/usr/share/munin/plugins/courier_mta_mailqueue is in munin-plugins-core 2.0.19-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 64 65 66 67 68 69 70 | #!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
courier_mta_mailqueue - Plugin to monitor courier-mta mail spool
=head1 CONFIGURATION
Configuration variables:
spooldir - Where to find mails in queue
The default configuration is:
[courier_mta_mailqueue]
env.spooldir /var/lib/courier/msgq/
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=head1 BUGS
None known
=head1 AUTHOR
Rune Nordbøe Skillingstad <runesk@linpro.no>
=head1 LICENSE
Unknown
=cut
# Can be set via environment, but default is /var/lib/courier/msgq/
SPOOLDIR=${spooldir:-/var/lib/courier/msgq/}
case $1 in
autoconf|detect)
if [ -d $SPOOLDIR/ -a -r $SPOOLDIR/ ] ; then
echo yes
exit 0
else
echo "no (spooldir not found)"
exit 0
fi;;
config)
cat <<'EOF'
graph_title Courier MTA mailqueue
graph_vlabel Mails in queue
graph_args --base 1000 -l 0
mails.label mails
mails.draw AREA
EOF
exit 0;;
esac
cd $SPOOLDIR >/dev/null 2>/dev/null || {
echo "# Cannot cd to $SPOOLDIR"
exit 1
}
cat <<EOF
mails.value $(find . -type f | wc -l | sed 's/ *//')
EOF
|