"Fossies" - the Fresh Open Source Software Archive

Member "munin-2.0.52/plugins/node.d/qmailscan.in" (20 Nov 2019, 1856 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 qmailscan - Plugin to graph output from qmailscan and clamav
    9 
   10 =head1 CONFIGURATION
   11 
   12 No configuration necessary.
   13 
   14 =head1 AUTHOR
   15 
   16 Contributed by David Obando (david@cryptix.de) - 03.12.2005
   17 
   18 =head1 LICENSE
   19 
   20 GPLv2
   21 
   22 =cut
   23 
   24 # define the logfiles. when you rotate them at any other time than 00:00 you have to define two logfiles:
   25 LOG0=/var/spool/qmailscan/quarantine.log
   26 LOG1=/var/spool/qmailscan/quarantine.log.1
   27 
   28 
   29 if [ "$1" = "autoconf" ]; then
   30         echo yes
   31         exit 0
   32 fi
   33 
   34 if [ "$1" = "config" ]; then
   35 
   36         echo 'graph_title Virus types'
   37         echo 'graph_args --base 1000 -l 0 '
   38         echo 'graph_vlabel Daily Virus Types'
   39         echo 'graph_category Mail'
   40         grep "$(date "+%d %b %Y")" "$LOG0" "$LOG1" | \
   41                grep -vE 'Disallowed  characters found in MIME headers|Disallowed breakage found in header name - potential virus|Disallowed MIME comment found in header name - potential virus' | \
   42                sed 's/clamdscan.*$//' | sed 's/[ \t]*$//' | \
   43                cut -f 5 | sort | uniq -c | sort -r | sed 's/\.\|-/_/g' | while read -r i; do
   44                        name=$(echo "$i" | awk '{print $2}')
   45                        echo "$name.label $name"
   46                        echo "$name.draw LINE2"
   47                done
   48 
   49         exit 0
   50 fi
   51 
   52 grep "$(date "+%d %b %Y")" "$LOG0" "$LOG1" | \
   53         grep -vE 'Disallowed  characters found in MIME headers|Disallowed breakage found in header name - potential virus|Disallowed MIME comment found in header name - potential virus' | \
   54         sed 's/clamdscan.*$//' | sed 's/[ \t]*$//' | \
   55         cut -f 5 | sort | uniq -c | sort -r | sed 's/\.\|-/_/g' | while read -r i; do
   56                 name=$(echo "$i" | awk '{print $2}')
   57                 printf "%s.value " "$name"
   58                 echo "$i" | awk '{print $1}'
   59         done