source: npl/mailserver/transparantspam/status @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 1.6 KB
Line 
1nice watch -n 1 '       
2        SAMPLE=60
3        START=`tail -$SAMPLE /home/system/dspam/system.log |head -1|egrep -o "^[0-9]+"`
4        NOW=`tail -1 /home/system/dspam/system.log|egrep -o "^[0-9]+"`
5        (( SPEED=(SAMPLE*60)/(NOW-START) ))
6        QUEUE=`/var/qmail2/bin/qmail-qstat|head -1|egrep -o "[0-9]+$"`
7        (( LAG=QUEUE/SPEED )) 2>/dev/null
8
9        uptime
10        echo "################### Inkomend #######################"
11       
12        IP=91.189.102.107
13        HOLD=`netstat -nap|grep $IP:25|grep SYN_RECV|wc -l`
14        EST=`netstat -nap|grep $IP:25|grep ESTABLISHED|grep - | wc -l`
15        ACTIVE=`netstat -nap|grep $IP:25 | grep ESTABLISHED|grep -v -|wc -l`
16        (( TOTAL=HOLD+EST+ACTIVE ))
17        echo "Huidige inkomende SMTP connecties   : $HOLD nieuw + $EST wachtend + $ACTIVE actief  = $TOTAL"
18
19        CONNS=`grep ' from ' /var/log/qmail2/qmail-smtpd/current |wc -l`
20        DROPPED=`grep 'rblsmtpd:' /var/log/qmail2/qmail-smtpd/current | wc -l`
21        if [ "$DROPPED" ] && [ "$CONNS" ]; then
22                (( DROPPERC=(100*DROPPED)/CONNS ))
23                echo "Black list percentage               : $DROPPERC %"
24        fi
25
26        echo "INKOMENDE QUEUE LENGTE              : $QUEUE"
27
28        echo
29        echo "################### Scanner  #######################"
30        echo "Input processen:"
31        ps ax|egrep "dspam" | grep -- "--user"|grep -v grep
32        ps ax|grep "amavis2dspam"| grep -v grep
33               
34        echo
35        echo "Dspam laatste resultaten:"
36        tail -5 /home/system/dspam/system.log|cut -f 6-8
37
38        echo
39        echo "Huidige scansnelheid : $SPEED mails/minuut"
40        echo "Geschatte wachttijd  : $LAG minuten."
41
42        echo
43        echo "################### Uitgaand #######################"
44        /var/qmail/bin/qmail-qstat
45        echo
46        tac /var/log/maillog|grep -v qmail2 | grep "starting delivery"|head -10 |tac|cut -f7- -d" "
47
48'
49
50
51
52
Note: See TracBrowser for help on using the repository browser.