2.6k Aufrufe
Gefragt in Linux von tomham Mitglied (407 Punkte)
Hallo Leute.
Hab mir heute calamaris installiert um meinen Squid auszuwerten.
Allerdings läuft er im Cron-Job auf einen Fehler an folgender Stelle:

eval `awk -F: \
'(!/¨#/) && ($1 == "daily") {
print "DAYMAIL=" $2; print "DAYWEB=" $3;
print "DAYDO=" $4; print "DAYTITLE=" $5;
}' $CONFFILE`

Ausgegebener Fehler:
awk: cmd. line:4: }
awk: cmd. line:4: ^ unexpected newline or end of string

Die Liste in $CONFFILE sieht so aus:
daily:administrator:/var/www/calamaris/daily.html:web:'Taeglicher Squid'
weekly:administrator:/var/www/calamaris/weekly.html:web:'Woechentlicher Squid'
monthly:administratos:/var/www/calamaris/monthly.html:web:'Monatlicher Squid'

Diese Dateien wurden mitm Calamaris installiert.

Weiters habe ich dann noch einen Fehler mit "bc":
DAYOFMONTH=`date +"%d" | bc -l`

Fehler:
./calamaris: line 28: bc: command not found


Konnte in den Foren betreffend Calamaris nichts darüber finden ...
Würd mich freuen wenn mir da wer weiterhelfen könnte.
LG Tom

11 Antworten

0 Punkte
Beantwortet von
wie wärs wenn du Basic Calculator, installierst ?
apt-get install bc

das teil benötigt das nämlich,
0 Punkte
Beantwortet von tomham Mitglied (407 Punkte)
apt-get install bc

Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package bc


Ist das in einem anderen Package verpackt ?
Unix-Version ist:
CentOS release 5.3 (Final)
0 Punkte
Beantwortet von
Managing Software with yum
also vermutlich

yum install bc

bringt's
0 Punkte
Beantwortet von tomham Mitglied (407 Punkte)
Also, das mitm bc hat sich nun gelöst, allerdings kommt der Fehler beim awk noch immer ...

awk: cmd. line:4: }
awk: cmd. line:4: ^ unexpected newline or end of string

Fehler in folgender Zeile:
eval `awk -F: \
'(!/¨#/) && ($1 == "daily") {
print "DAYMAIL=" $2; print "DAYWEB=" $3;
print "DAYDO=" $4; print "DAYTITLE=" $5;
}' $CONFFILE`
0 Punkte
Beantwortet von
wie hast du calamaris installiert ?
bist einer anleitung nachgegangen ? version ?
funktioniert c. in der shell ?
auf einem debian

calamaris -a -F html /var/log/squid3/access.log > /var/www/calamaris/index.html
o.
calamaris /pathtosquidlog | less


calamaris funktioniert wohl, aber anscheinend wird's nicht weiter entwickelt/gepflegt
willst dich nicht nach alternative umsehen ?
und lerne yum, dein centos braucht vermutlich updates ! o. wird das automatisch erledigt ?
0 Punkte
Beantwortet von
bei mir

mac@atomi:~/src/calamaris-2.59$ awk --version | head -1
GNU Awk 3.1.5

und bei dir ?
0 Punkte
Beantwortet von tomham Mitglied (407 Punkte)
Hab calamaris über apt-get installiert und die config von meinem alt-server kopiert und angepasst. Calamaris aus der Shell raus funktioniert, liefert mir auch die richtige Auswertung ...
awk --version
GNU Awk 3.1.5
0 Punkte
Beantwortet von
ist die datei cron.conf vorhanden, pfad angabe ist auch richtig, was sagt file dazu ?
event. hast du es mit Windows-Notepad bearbeitet ?
der abschnitt schaut bei mir so aus

eval `awk -F: \
'(!/¨#/) && ($1 == "daily") {
print "DAYMAIL=" $2; print "DAYWEB=" $3;
print "DAYDO=" $4; print "DAYTITLE=" $5;
}' $CONFFILE`

und in der shell


atomi:/etc/cron.daily# awk -F: '(!/¨#/) && ($1 == "daily") {
print "DAYMAIL=" $2; print "DAYWEB=" $3;
print "DAYDO=" $4; print "DAYTITLE=" $5;
}' /etc/calamaris/cron.conf
DAYMAIL=root
DAYWEB=/var/www/calamaris/daily/index.html
DAYDO=web
DAYTITLE='Taeglicher Squid'
0 Punkte
Beantwortet von tomham Mitglied (407 Punkte)
Hi.
Also, grad nochmal meinen Code durchgeschaut (in der Shell gings auch nicht), da hat doch der vim tatsächlich immer wieder die Klammern doppelt gemacht ... immer wenn ich über eine "Klammer auf" gefahren bin mitm Cursor hat er mir irgendwo weiter hinten ne "Klammer zu" gemacht ...

Sowiet funktioniert also der Abschnitt jetzt.
Aber jetzt hab ich woanders ein Problem:

CACHELOGDIR=/usr/local/squid/var/logs
CALAMARIS=/usr/bin/calamaris
CALAMARISOPTIONS="-a -f auto -U M"
HTMLOPTIONS="-F html"

#Hier kommt wo ein Fehler
cat $CACHELOGDIR/access.log | \
nice -39 $CALAMARIS $CALAMARISOPTIONS $HTMLOPTIONS -H "$DAYTITLE" \
--output-file /var/www/calamaris/daily.html

Unknown option: -

no requests found
0 Punkte
Beantwortet von
2.99.4.0 ?
versionen ? war gemeint dass du es mir mitteilst, musste ich es besser formulieren ?
calamaris --version

hier
steht

/var/log/squid/
bei dir
/usr/local/squid/var/logs

stimmt das ?
ich kann dir nicht alles abnehmen du muss auch selber etwas tun und denken

cat /usr/local/squid/var/logs/access.log | nice -39 /usr/bin/calamaris -a -f squid -U M \
-F html -H "Squid Proxy @ Home" > /tmp/daily.html

du kanns es aufteilen in

cat /usr/local/squid/var/logs/access.log
... ausgabe ...
nice -39 ls
... ls ausgabe ...
cat /usr/local/squid/var/logs/access.log | nice -39 /usr/bin/calamaris -a -f squid -U M \
-F html -H "Squid Proxy @ Home" | less
... calamaris HTML ausgabe ...

Unknown option: -

no requests found

wo der bindestrich her kommt musst selber rausfinden,
no requests found hat vermutlich viele ursachen, z.B. logfile ist leer
zukünftig mach mehr angaben, versionen, wie, anleitung bitte
bye
...