-rwsr-sr-t 1 root root 6992 2007-11-30 11:34 wrapper
451 Qq Temporary Problem (#4.3.0)
index.php Line 51:
.pass { font-weight: bold; color: #009900}
.block { font-weight: bold; color: #0000CC}
.virus { font-weight: bold; color: #CC0000}
.error { font-weight: bold; color: #FFFF00}
.attach { font-weight: bold; color: #FFFF0A}
.fett { font-weight: bold;}
funcs.php Line 100:
echo "<td width=\"5%\">";
//.($formattedlog[$i]["flag"]=="QUEUE" ? "<span class=\"pass\">" : "<span class=\"block\">").$formattedlog[$i]["flag"]."</span></td>\n";
switch ($formattedlog[$i]["flag"]){
case "ERROR":
$error_ctr++;
echo "<span class=\"error\">";
break;
case "SPAM":
$spam_ctr++;
echo "<span class=\"block\">";
break;
case "VIRUS":
$virus_ctr++;
echo "<span class=\"virus\">";
break;
case "HEADER":
$header_ctr++;
echo "<span class=\"block\">";
break;
case "CUSTOM":
$custom_ctr++;
echo "<span class=\"block\">";
break;
case "ATTACH":
$attach_ctr++;
echo "<span class=\"attach\">";
break;
case "QUEUE":
$queue_ctr++;
echo "<span class=\"pass\">";
break;
}
echo $formattedlog[$i]["flag"]."</span></td>\n";
#!/bin/sh
#
# Produces mrtg values
#
# -b$, Fri Dec 3 14:25:05 EET 2004
#
spam=`cat /var/log/qsheff.log | grep 'SPAM' |grep -v '127.0.0.1' | grep recvfrom
| wc -l`
queue=`cat /var/log/qsheff.log | grep -v '127.0.0.1' | grep recvfrom | grep 'QUE
UE' | wc -l`
virus=`cat /var/log/qsheff.log | grep -v '127.0.0.1' | grep recvfrom | grep 'VIR
US' | wc -l`
attach=`cat /var/log/qsheff.log | grep -v '127.0.0.1' | grep recvfrom | grep 'AT
TACH' | wc -l`
queue=`expr $queue + 0`
spam=`expr $spam + 0`
virus=`expr $virus + 0`
attach=`expr $attach + 0`
#
# here to check for bad IPs spamming before rotating the logfile
#
# 10 mails pro Stunde an Müll und die IP sperren -
# alternativ mit: iptables -I INPUT 1 -s $1 -j DROP im LOOP statt echo $line
THRESHOLD=10
LOGFILE=/var/log/qsheff.log
BADFILE=/var/qmail/control/badmailfrom
IPFILE=/etc/qsheff-II/ips.txt
UNIQUEIPFILE=/etc/qsheff-II/unique_ips.txt
STATSFILE=/etc/qsheff-II/qsheff.stats
JETZT=`/bin/date`
rm -f $IPFILE
rm -f $UNIQUEIPFILE
rm -f $STATSFILE
cat $LOGFILE | grep SPAM | grep -v '127.0.0.1' | grep recvfrom | cut -d',' -f3 |
cut -c11- > $IPFILE
cat $LOGFILE | grep ATTACH | grep -v '127.0.0.1'| grep recvfrom | cut -d',' -f3
| cut -c11- >> $IPFILE
cat $LOGFILE | grep VIRUS | grep -v '127.0.0.1'| grep recvfrom | cut -d',' -f3 |
cut -c11- >> $IPFILE
cat $IPFILE | sort -u > $UNIQUEIPFILE
cat $UNIQUEIPFILE |
while read line; do
count=$(grep $line $IPFILE | wc -l);
if [ $count -gt $THRESHOLD ]; then echo $line; fi
done >> $BADFILE
echo "Statistik der letzten Stunde berechnet um :"$JETZT"" > $STATSFILE
echo "SPAMS :"$spam"" >> $STATSFILE
echo "VIRUS :"$virus"" >> $STATSFILE
echo "ATTACH:"$attach"" >> $STATSFILE
echo "QUEUE :"$queue"" >> $STATSFILE
# end bad ips spamming
#now lets rotate logfile and report to mrtg
cat /var/log/qsheff.log >> /var/log/qsheff.log.cumulative
echo -n > /var/log/qsheff.log
echo $queue # As MRTG in
echo $spam # As MRTG out
echo
#############################################################
Title[spam]: Rejected Messages
MaxBytes[spam]: 10000
AbsMax[spam]: 20000
Options[spam]: gauge
Target[spam]: `<pfad zum docroot des webvhosts>/qsheff/qsh
eff-mrtg.sh`
PageTop[spam]: <B>Spam</B><br>
ShortLegend[spam]: mails
YLegend[spam]: mails/hour
Legend1[spam]: clean MAILS
Legend2[spam]: rejected SPAM
Legend3[spam]:
Legend4[spam]:
LegendI[spam]: CLEAN:
LegendO[spam]: SPAM:
WithPeak[spam]: ymwd
XSize[spam]: 350
YSize[spam]: 150
# qSheff MRTG
0 * * * * /usr/bin/mrtg <pfad zum docroot des webvhosts>/qsheff/qsheff-mrtg.cfg >/dev/null 2>&1
/var/log/qsheff.log.cumulative {
compress
dateext
maxage 10
rotate 99
missingok
notifempty
size +1024k
create 644 root root
}
Schau Dir mal folgende Seite an und überlege Dir, ob Dein Vorhaben sinnvoll ist, oder nicht: Unix-Dateirechte ? WikipediaDes Weiteren sind die Rechte der Datei qsheff-log in meinem cron.daily Ordner auf 0644. Sollten diese nicht wie alle anderen Dateien in diesem Ordner auf 0755 gesetzt werden?
Soll ich daraus schließen, dass es derzeit keine neuere Version gibt oder funktioniert die Updatefunktion nicht?
#!/bin/sh
logdate=`date -d "-11 day" +"%d/%m/%Y"`
#echo ${logdate}
/usr/local/psa/admin/bin/mailmng -o
cd /var/log
cat qsheff.log | grep "${logdate}" >> qsheff-old.log
cat qsheff.log | grep -v "${logdate}" >> qsheff.log.tmp
mv -f qsheff.log.tmp qsheff.log
/usr/local/psa/admin/bin/mailmng -p
cd /var/qsheff/quarantine
find -depth -name mesg -mtime +9 -type f -daystart -delete
find -name "*-*-*" -type d -empty -delete
#include <iostream>
using namespace std;
main(int argc, char *argv[])
{
string action = argv[1];
string data1 = argv[2];
string data2 = argv[3];
string cmd = "./restoremsg.sh " + data1 + " " + data2;
if (action == "2") system ( cmd.c_str() );
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.