-   Linux - Newbie (
-   -   Query related to syslog? (

your_shadow03 05-15-2009 05:21 AM

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
1. vi /etc/sysconfig/syslog
-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

druuna 05-15-2009 05:29 AM


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


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.

your_shadow03 05-15-2009 05:42 AM

I have two Machine : on which I made entry:

1. vi /etc/sysconfig/syslog

Restarted syslog.

On Client I made entry in /etc/syslog.conf

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

*.info;mail.none;authpriv.none;cron.none                @

As I restarted the syslog it says:

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?

druuna 05-15-2009 05:48 AM


That looks correct.

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

So, if the following rule is present on (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.

your_shadow03 05-15-2009 05:52 AM


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

druuna 05-15-2009 10:32 AM


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:


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

All times are GMT -5. The time now is 07:32 PM.