[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Logcheck e logfiles



On Wed, 28 Mar 2007 16:29:57 +0200
NN_il_Confusionario <pinkof.pallus@tiscalinet.it> wrote:

> io proverei due cose:
> 
> * semplificare la regexp sopra per vedere se e` un problema di regexp;
> per esempio brutalmente usare solo
> SMART Prefailure Attribute: 8 Seek_Time_Performance changed

Allora ho provato a mettere questa linea:
SMART Prefailure Attribute: 8 Seek_Time_Performance changed

ma ancora non funzia. Per chiarire le cose ecco come faccio:
Ho trovato su qualche readme questo:

To test new rules, you can grep your log file, and remove trailing
space with something like this:

    sed -e 's/[[:space:]]*$//' /var/log/syslog | egrep \
    '^\w{3} [ :0-9]{11} oempc wwwoffled\[[0-9]+\]: WWWOFFLE (On|Off)line\.$'

If the log line is displayed, then your regex works.

Quando lancio questo comando la linea viene vista, quindi in teoria è
corretta.
Però se lancio:

su -s /bin/bash -c "/usr/sbin/logcheck -o -t" logcheck

Questo mi riporta sempre:

Security Events
=-=-=-=-=-=-=-=
Mar 28 06:31:49 mir smartd[4915]: Device: /dev/hda, SMART Prefailure Attribute: 8 Seek_Time_Performance changed from 253 to 252
Mar 28 08:01:49 mir smartd[4915]: Device: /dev/hda, SMART Prefailure Attribute: 8 Seek_Time_Performance changed from 252 to 253 
Mar 28 16:47:18 mir smartd[4915]: Device: /dev/hda, SMART Prefailure Attribute: 8 Seek_Time_Performance changed from 252 to 253

Non riesco proprio a capire dove sbaglio. Forse testare la linea con
sed/grep non è affidabile? Ci sono altri modi?


> 
> * eseguire logchek sotto strace p[er assicurarsi che il file di conf in
> cui hai messo la regexp sia realmente usato

Beh, non capisco molto l'output di strace.
Il file di prova è /etc/logcheck/ignore.d.server/ciccio

Ho lanciato logcheck così:
su -s /bin/bash -c "strace /usr/sbin/logcheck -o -t" logcheck &> log

Risultato:
cat log|grep ciccio

read(3, "ciccio\n", 128)                = 7
stat64("/etc/logcheck/ignore.d.server/ciccio", {st_mode=S_IFREG|0640, st_size=161, ...}) = 0

Sembra ok, sbaglio?



Reply to: