| View previous topic :: View next topic |
| Author |
Message |
ferreirafm Guru

Joined: 28 Jul 2005 Posts: 434 Location: Sao Paulo, Brazil
|
Posted: Fri Jan 04, 2013 1:32 pm Post subject: [SOLVED] help with syslog-ng wanted |
|
|
Hi Forum,
I would like to send the SMART log messages to a separate file instead of to /var/log/messages.
From the SMART manpages it seems very simple task using the SYSLOG daemon. However, the default Gentoo syslog program is the SYSLOG-NG, which is pretty difficult to config.
Please, could some syslog-ng expert give me a hand?
Best
Last edited by ferreirafm on Mon Jan 07, 2013 1:08 pm; edited 1 time in total |
|
| Back to top |
|
 |
audiodef Advocate


Joined: 06 Jul 2005 Posts: 4952
|
Posted: Sat Jan 05, 2013 4:13 pm Post subject: |
|
|
If you compile syslog-ng with the "hardened" use flag, syslog should create separate logs for processes that post to /var/log. You should edit /etc/portage/package.use and add:
| Code: |
app-admin/syslog-ng hardened
|
and re-emerge syslog-ng. _________________ Gentoo Studio: http://gentoostudio.org
Pappy's Kernel Seeds: http://kernel-seeds.gentoostudio.org
Linux 'Tude Tees: http://skreened.com/geektudetees
A cloud is evaporated water in the sky, thanks. |
|
| Back to top |
|
 |
gentoo_ram Guru

Joined: 25 Oct 2007 Posts: 395 Location: San Diego, California USA
|
Posted: Sun Jan 06, 2013 6:21 pm Post subject: |
|
|
You want to use filters. I'm going to assume the SMART messages are from the program "smartd".
| Code: |
source src { unix-stream("/dev/log" max-connections(256));
internal(); file("/proc/kmsg"); udp6(keep_timestamp(no));
tcp6(keep_timestamp(no)); };
filter messagesf { not program("smartd"); };
filter smartf { program("smartd"); };
destination messages { file("/var/log/messages"); };
destination smartlog { file("/var/log/smartd"); };
log { source(src); filter(messagesf); destination(messages); };
log { source(src); filter(smartf); destination(smartlog); };
|
|
|
| Back to top |
|
 |
ferreirafm Guru

Joined: 28 Jul 2005 Posts: 434 Location: Sao Paulo, Brazil
|
Posted: Mon Jan 07, 2013 1:19 pm Post subject: |
|
|
Both suggestions helped. Just to clarify, audiodef suggestion will separate most of the daemon logfiles from messages. At least in my case, I still had to edit syslog-ng according to gentoo_ram.
All the Best. |
|
| Back to top |
|
 |
|