Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Risolto]Problema con sintassi di syslog-bg.conf
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
Sephirot
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2004
Posts: 124
Location: Milano

PostPosted: Mon Aug 21, 2006 5:47 pm    Post subject: [Risolto]Problema con sintassi di syslog-bg.conf Reply with quote

Salve,
stavo smanettando con il file di configurazione di syslog in modo da avere i messaggi relativi a sshd in un file a parte chiamato ssh.log.

Quindi ho aggiunto una filtro:

Code:
# Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett

#options
        chain_hostnames(off);
        sync(0);

        # The default action of syslog-ng 1.6.0 is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats(43200);
};

#sorgenti
source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };

#destinazioni
destination messages { file("/var/log/messages"); };
destination console_all { file("/dev/tty12"); };
destination sshlog { file("/var/log/ssh.log"); };

#filtri
filter f_ssh { match("sshd"); };

#log = filtri + destinazioni
log { source(src); destination(messages); };
log { source(src); destination(console_all); };
log { source(src); filter(f_ssh); (destination(ssh); };


Adesso quando vado a riavviare syslog-ng mi dice:
Code:
arcadia sephi # /etc/init.d/syslog-ng start
syntax error at 7
Parse error reading configuration file, exiting. (line 7)
 * Configuration error. Please fix your configfile (/etc/syslog-ng/syslog-ng.conf)


Ma la riga 7 non l'ho toccata e non capisco dove sia l'errore.
_________________
"Gentoo is more educational than mainstream distros. It encourages you to look under the hood and effectively turns a lot of n00bs into l33ts."
resistence is futile
(if < 1 ohm)


Last edited by Sephirot on Tue Aug 22, 2006 12:17 am; edited 1 time in total
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Mon Aug 21, 2006 6:14 pm    Post subject: Re: Problema con sintassi di syslog-bg.conf Reply with quote

esperimento: prova a commentare sync(0);
Back to top
View user's profile Send private message
Sephirot
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2004
Posts: 124
Location: Milano

PostPosted: Mon Aug 21, 2006 6:35 pm    Post subject: Reply with quote

niente, solito problema alla riga 7.
Thanks cmq.
_________________
"Gentoo is more educational than mainstream distros. It encourages you to look under the hood and effectively turns a lot of n00bs into l33ts."
resistence is futile
(if < 1 ohm)
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Mon Aug 21, 2006 6:51 pm    Post subject: Reply with quote

la questione è che la riga 7 è vuota
probabilmente ignora le righe con i commenti, quindi la riga 7 è in realtà la settima riga nn commentata
Back to top
View user's profile Send private message
klaimath
Apprentice
Apprentice


Joined: 18 Jun 2006
Posts: 213

PostPosted: Mon Aug 21, 2006 6:57 pm    Post subject: Re: Problema con sintassi di syslog-bg.conf Reply with quote

Code:

options {
        chain_hostnames(off);
        sync(0);

        # The default action of syslog-ng 1.6.0 is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats(43200);
};


Saluti
Klaimath
Back to top
View user's profile Send private message
Sephirot
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jun 2004
Posts: 124
Location: Milano

PostPosted: Tue Aug 22, 2006 12:14 am    Post subject: Reply with quote

Si e' vero! Grazie mille!

Ora funziona perfettamente, in realta' c'erano anche un altro paio di correzioni da apportare, per chi fosse interessato posto qui il file di conf di syslog-sn. Per ora "screma" i log di sshd in un file che ho chiamato ssh.log. Ma si puo' facilmente aggiungere qualsiasi altro tipo di filtro :)

Code:
# Syslog-ng default configuration file for Gentoo Linux
# contributed by Michael Sterrett

options {
        chain_hostnames(off);
        sync(0);

        # The default action of syslog-ng 1.6.0 is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats(43200);
};

#sorgenti
source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); };

#destinazioni
destination messages { file("/var/log/messages"); };
destination console_all { file("/dev/tty12"); };
destination ssh { file("/var/log/ssh.log"); };

#filtri
filter f_ssh { match("sshd"); };

#log = filtri + destinazioni
log { source(src); destination(messages); };
log { source(src); destination(console_all); };
log { source(src); filter(f_ssh); destination(ssh); };

_________________
"Gentoo is more educational than mainstream distros. It encourages you to look under the hood and effectively turns a lot of n00bs into l33ts."
resistence is futile
(if < 1 ohm)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum