webserver statistik auswerten

This commit is contained in:
age 2006-01-08 17:42:26 +00:00
parent 91e73a0f9d
commit 5995a8775b
2 changed files with 38 additions and 8 deletions

View file

@ -7,19 +7,23 @@ DEST="access.log.all"
#[ -e ${SRC}.1.gz ] && gzip $SRC ${SRC}.1.gz
rm $DEST
for vers in ${VERSIONS[@]}
do
file=${SRC}.${vers}.gz
echo $file
zcat $file >> $DEST
echo -e "\n" >> $DEST
done
## nur falls die logs auf mehrere dateien verteilt sind,
#for vers in ${VERSIONS[@]}
#do
#file=${SRC}.${vers}.gz
#echo $file
#zcat $file >> $DEST
#echo -e "\n" >> $DEST
#done
## ein paar ersedzungen
sed '/Python-urllib/d' $DEST > ${DEST}.a
sed '/\"Wget\/1\.9\.1\"/d' $DEST.a > ${DEST}.b
sed '/U\;\ Nessus/d' $DEST.b > ${DEST}.c
sed '/action=rss/d' $DEST.c > ${DEST}.d
sed 's/^/127.0.0.1 /' $DEST.d > ${DEST}.e
# den report gengerieren
visitors --prefix https://systemausfall.org -XKUWDOBT -m 30 ${DEST}.e -o html > ${SRC}_sao_report_raw.html

View file

@ -0,0 +1,26 @@
#!/bin/bash
set -u
#DATE=`date '+%Y-%m'`
DATE=`date -d '1 month ago' '+%Y-%m'`
SRC="/var/log/apache/access-${DATE}.log"
DST_SAO="/tmp/access-${DATE}_sao.log.shrunk"
DST_SOBI="/tmp/access-${DATE}_sobi.log.shrunk"
nice -n 10 cat ${SRC} | grep "webproxy pound" | grep "systemausfall.org" > ${DST_SAO}
[ -e ${DST_SAO}.gz ] && rm ${DST_SAO}.gz
gzip ${DST_SAO}
nice -n 10 cat ${SRC} | grep "webproxy pound" | grep "soziale-bildung.org" > ${DST_SAO}
[ -e ${DST_SAO}.gz ] && rm ${DST_SAO}.gz
gzip ${DST_SAO}
## we have no mailservice at all
#MAILBODY="scp uml-webproxy@systemausfall.org:/var/log/access.log.now.gz . && \n gunzip access.log.now && \n visitors -A -m 30 access.log.now --prefix systemausfall.org -o html > report-${DATE}.html"
#echo $MAILBODY > /tmp/foo
#mutt -n -F /dev/null -s "access.log" age < /tmp/foo
#rm $SRC