LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-15-2009, 05:21 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,436
Blog Entries: 6

Rep: Reputation: 51
Query related to syslog?


Say, You are a System administrator. Using Log files make it very easy to identify problems. Now there are 50 servers running as Mail, Web, Proxy, DNS etc. You want to centralize the log from all servers
onto a LOG Server. How will you configure the LOG Server?

Answer and Explanation:

By Default System Accept the Log only from the Local host. To accept the Log from other host
configure:
1. vi /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0 -r"
Where
-m 0 disables 'MARK' messages.
-r enables logging from remote machines
-x disables DNS lookups on messages received with -r
2. service syslog restart

How can these entries enable this machine to behave a central server?
Say, I followed the steps so what next? Do I need to configure clients to send the logs to this server?pls advise
 
Old 05-15-2009, 05:29 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

What you show (points 1 and 2) is server side, but you also need to tell the client(s) side were to send the (sys)log entries.

An entry like the following (client site, syslog.conf) will send all emergencies to the log server called arpa.berkeley.edu:

*.emerg @arpa.berkeley.edu

The above example is taken from the syslog.conf man page.

BTW: You do need to restart the syslog facility on the client side as well if you make changes.

Last edited by druuna; 05-15-2009 at 05:31 AM.
 
Old 05-15-2009, 05:42 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,436
Blog Entries: 6

Original Poster
Rep: Reputation: 51
I have two Machine : 192.168.1.23 on which I made entry:
Code:
1. vi /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0 -r"
Restarted syslog.

On Client 192.168.1.24 I made entry in /etc/syslog.conf
as:
Code:
#*.info;mail.none;authpriv.none;cron.none               /var/log/messages

*.info;mail.none;authpriv.none;cron.none                @192.168.1.23
As I restarted the syslog it says:
Code:
May 15 03:19:52 BL kernel: Kernel logging (proc) stopped.
May 15 03:19:52 BL kernel: Kernel log daemon terminating.
May 15 03:19:53 BL syslog: klogd shutdown succeeded
May 15 03:19:53 BLexiting on signal 15
Is it correct? If yes, then where will it throw the system log now which it earlier used to put under /var/log/messages?

Last edited by your_shadow03; 05-15-2009 at 05:44 AM.
 
Old 05-15-2009, 05:48 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

That looks correct.

After the client sends the log entry to 192.168.1.23, the syslog.conf rules on 192.168.1.23 (server) will put the message in the appropriate logfile.

So, if the following rule is present on 192.168.1.23 (server), it will be written to /var/log/messages:

*.info;mail.none;authpriv.none;cron.none /var/log/messages

BTW: You don't have to comment out the entry (client site), if both rules are present (one writes it local and the other sends it to the log server) both rules are used and the log message is stored locally and remote.
 
Old 05-15-2009, 05:52 AM   #5
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,436
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Thanks.

How can I check if it is really throwing logs there in remote server.
Any command which will throw some output?

Last edited by your_shadow03; 05-15-2009 at 06:40 AM.
 
Old 05-15-2009, 10:32 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Didn't pick up on your edit earlier, better to post a new entry (same thread though) next time.

Anyway, to answer your question:

Take a look at logger, it was made to test the syslog log system.
You can specify facility-level pairs, add messages and tags and more (do take a look at the manpage).

2 examples from the manpage:

Quote:
logger System rebooted
logger -p local0.notice -t HOSTIDM -f /dev/idmc
This command is also nice to use in scripts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Query related to Git? your_shadow03 Linux - Newbie 10 04-23-2009 11:35 PM
Query related to sudo? your_shadow03 Linux - Newbie 2 04-22-2009 12:21 AM
shell related query !!!!!!!!!!! iacharyya Linux - General 10 06-09-2008 06:39 PM
One query related libstdc++.so.5 utkarshrawat Linux - Newbie 2 05-27-2008 02:01 AM
kernel related query abhidude Linux - General 2 11-29-2004 09:09 AM


All times are GMT -5. The time now is 08:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration