diff --git a/spielspass/logkosmetik.sh b/spielspass/logkosmetik-client.sh similarity index 52% rename from spielspass/logkosmetik.sh rename to spielspass/logkosmetik-client.sh index 537d8b6..92d39ff 100755 --- a/spielspass/logkosmetik.sh +++ b/spielspass/logkosmetik-client.sh @@ -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 + diff --git a/spielspass/logkosmetik-server.sh b/spielspass/logkosmetik-server.sh new file mode 100755 index 0000000..8912bec --- /dev/null +++ b/spielspass/logkosmetik-server.sh @@ -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 + + +