把日誌寫到其他伺服器上的操作步驟

tonykorn97發表於2008-05-09

1,first, on the log server set up syslogd to accept remote memmages.
a, EDIT /etc/sysconfig/syslog;
YSSLOGD_OPTIONS="-r -m 0 "
b, restart syslogd;
# service syslog restart

[@more@]

2, on the log client set up syslogd to send messages from the user facility to the log server.
a, Append in /etc/syslog.conf the following line:
user.* @172.25.1.114
b, restart syslogd
#service syslog restart

3, test the new setup by using logger to generate a syslog messages.does the message appear in you neighbor's /var/log/messages?
#logger -i -t root "This is a test"

伺服器日誌資訊
[root@tonykorn97 ~]# tail -f /var/log/messages
May 9 20:01:34 tonykorn97 syslog: klogd startup succeeded
May 9 20:01:34 tonykorn97 syslog: syslogd shutdown succeeded
May 9 20:03:10 172.25.1.115 root: it this is a test

[root@tonykorn97 ~]#

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-1003724/,如需轉載,請註明出處,否則將追究法律責任。

相關文章