"Fossies" - the Fresh Open Source Software Archive

Member "munin-2.0.52/plugins/node.d/courier_mta_mailqueue.in" (20 Nov 2019, 1117 Bytes) of package /linux/misc/munin-2.0.52.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!@@GOODSH@@
    2 # -*- sh -*-
    3 
    4 : << =cut
    5 
    6 =head1 NAME
    7 
    8 courier_mta_mailqueue - Plugin to monitor courier-mta mail spool
    9 
   10 =head1 CONFIGURATION
   11 
   12 Configuration variables:
   13 
   14  spooldir - Where to find mails in queue
   15 
   16 The default configuration is:
   17 
   18  [courier_mta_mailqueue]
   19   env.spooldir /var/lib/courier/msgq/
   20 
   21 =head1 MAGIC MARKERS
   22 
   23  #%# family=auto
   24  #%# capabilities=autoconf
   25 
   26 =head1 BUGS
   27 
   28 None known
   29 
   30 =head1 AUTHOR
   31 
   32 Rune Nordbøe Skillingstad <runesk@linpro.no>
   33 
   34 =head1 LICENSE
   35 
   36 Unknown
   37 
   38 =cut
   39 
   40 # Can be set via environment, but default is /var/lib/courier/msgq/
   41 SPOOLDIR=${spooldir:-/var/lib/courier/msgq/}
   42 
   43 case $1 in
   44     autoconf|detect)
   45 	if [ -d "$SPOOLDIR/" ] && [ -r "$SPOOLDIR/" ] ; then
   46 	    echo yes
   47 	    exit 0
   48         else
   49 	    echo "no (spooldir not found)"
   50 	    exit 0
   51         fi;;
   52     config)
   53 	cat <<'EOF'
   54 graph_title Courier MTA mailqueue
   55 graph_vlabel Mails in queue
   56 graph_args --base 1000 -l 0
   57 mails.label mails
   58 mails.draw AREA
   59 EOF
   60 	exit 0;;
   61 esac
   62 
   63 cd "$SPOOLDIR" >/dev/null 2>/dev/null || {
   64      echo "# Cannot cd to $SPOOLDIR"
   65      exit 1
   66 }
   67 
   68 cat <<EOF
   69 mails.value $(find . -type f | wc -l | sed 's/ *//')
   70 EOF