Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] help with syslog-ng wanted
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 468
Location: Sao Paulo, Brazil

PostPosted: Fri Jan 04, 2013 1:32 pm    Post subject: [SOLVED] help with syslog-ng wanted Reply with quote

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
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 5282

PostPosted: Sat Jan 05, 2013 4:13 pm    Post subject: Reply with quote

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
Facebook: http://www.facebook.com/gentoostudio
G+: https://plus.google.com/113947758237122861689/posts
Pappy's Kernel Seeds: http://kernel-seeds.org
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 398
Location: San Diego, California USA

PostPosted: Sun Jan 06, 2013 6:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 468
Location: Sao Paulo, Brazil

PostPosted: Mon Jan 07, 2013 1:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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