Halo
Ich hab problem bei der umwandlung von pflog zu text datei.
ich will den skript pflogrotate wie in openbsd webseite ausgefuehrt.
Alle Anweisungen fuer pflogrotate (wie in openbsd webseite zum thema pf logging)
hab ich schon durchgefuehrt und das funktioniert nicht.
Die Datei pflog5min* ist schon erstellt, aber der befehl
tcpdump -n -e -ttt -r $logfile | logger -t pf -p local0.info
schein nicht zu funktionieren.
ich hab den skript als user pflogger(wie in openbsd Docu beschrieben)
und auch dannach root ausgefuehrt.
hier sind die befehle die von mir ausgefuehrt werden.
pflog.txt hat die grosse 0.
was hab ich hier falsch gemacht ? kann jemand mir helfen?
oder hat jemand eine andere loesung zum thema logfile als text.file ?
link zu original Datei : http://www.openbsd.org/faq/pf/logging.html
Danke
Acelerati
Ich hab problem bei der umwandlung von pflog zu text datei.
ich will den skript pflogrotate wie in openbsd webseite ausgefuehrt.
Alle Anweisungen fuer pflogrotate (wie in openbsd webseite zum thema pf logging)
hab ich schon durchgefuehrt und das funktioniert nicht.
Die Datei pflog5min* ist schon erstellt, aber der befehl
tcpdump -n -e -ttt -r $logfile | logger -t pf -p local0.info
schein nicht zu funktionieren.
ich hab den skript als user pflogger(wie in openbsd Docu beschrieben)
und auch dannach root ausgefuehrt.
hier sind die befehle die von mir ausgefuehrt werden.
Code:
/etc/pflogrotate
FILE=/root/pflogger/pflog5min.$(date "+%Y%m%d%H%M")
kill -ALRM $(cat /var/run/pflogd.pid)
if [ $(ls -l /var/log/pflog | cut -d " " -f 8) -gt 24 ]; then
mv /var/log/pflog $FILE
kill -HUP $(cat /var/run/pflogd.pid)
fi
/root/pflogger/pfl2sysl
for logfile in /root/pflogger/pflog5min* ; do
if [ -s "$logfile" ]; then
tcpdump -n -e -ttt -r $logfile | logger -t pf -p local0.info
rm $logfile
fi
done
root's cron job:
# crontab -u root -e
# rotate pf log file every 5 minutes
0-59/5 * * * * /bin/sh /etc/pflogrotate
# feed rotated pflog file(s) to syslog
0-59/5 * * * * /bin/sh /root/pflogger/pfl2sysl
und in /etc/syslog.conf:
local0.info /var/log/pflog.txt
pflog.txt hat die grosse 0.
was hab ich hier falsch gemacht ? kann jemand mir helfen?
oder hat jemand eine andere loesung zum thema logfile als text.file ?
link zu original Datei : http://www.openbsd.org/faq/pf/logging.html
Danke
Acelerati
Zuletzt bearbeitet: