domingo, 20 de junio de 2004

Estadisticas para ClamAV, en plan cutre

awk '/INFECTED/ { print $8}' /var/log/maillog.1 | \
sed -e 's,(\(.*\))\,,\1,' | sort | uniq -c | sort -nr



Otra opicion:
-------------------------------------------------------------------

valerts=/var/mail/virtual/unsec.net/virusalert
var1=`grep "Subject: VIRUS" $valerts | sed -e 's,.*(\(.*\)).*,\1,g' \
| sort | uniq -c| sort -nr`
var2=`grep -A1 'The message WAS NOT delivered to' $valerts | \
grep -e '^<.*:$' | sed -e 's,:,\1,' \
| sort | uniq -c | sort -nr`
var3=`echo "$var1" | awk '{ print $1 }' | tr '\n' '+' | sed -e s,.$,,`
var4=$(( $var3 ))
echo " "
echo ".:[ Estadisticas generales ]:."
echo "------------------------------"
echo "Numero total de mails infectados: $var4"
echo " "
echo ".:[ Virus encontrados ]:."
echo "-------------------------"
echo "$var1"
echo " "
echo ".:[ Recipientes con mas virus ]:."
echo "---------------------------------"
echo "$var2"