Monday, December 24, 2007

Remote Log Server using syslog-ng!

#1. 安裝syslog-ng [1]

#aptituide install syslog-ng

----------------------------------------------------------------------------------
#2. 設定/etc/syslog-ng/syslog-ng.conf。加上下面這些文字。[1]
(Server side:接收遠端傳送的log file。)
#
# If you wish to get logs from remote machine you will need this server
# to listen upon port 514.
#
source remote { tcp(port(514) keep-alive(no)); };

#
# Automatic host sorting
# Store all files beneath '/var/log/NAME OF MACHINE/facility
# Create these directories if required, with the given permissions.
#
destination hosts { file("/var/log/HOSTS/$HOST/$FACILITY" owner(root)
group(root) perm(0600) dir_perm(0700) create_dirs(yes)); };

#
# log by host (as defined above) anything that's coming from the
# remote socket.
#
log { source(remote); destination(hosts); };

----------------------------------------------------------------------------------
3.重新啟動syslog-ng服務。[1]

#/etc/init.d/syslog-ng restart

----------------------------------------------------------------------------------
參考網站:
[1]. Debian Administration - Sending system messages to a central location.
http://www.debian-administration.org/articles/24

[2]. Wiki of Ubuntu - Quick HOWTO : Ch05 : Troubleshooting Linux with syslog
http://wiki.ubuntu.org.cn/index.php?title=Quick_HOWTO_:_Ch05_:_Trouble
shooting_Linux_with_syslog&variant=zh-tw


[3]. Ubuntuforu
ms - [SOLVED] syslog-ng with dlink router
http://ubuntuforums.org/showthread.php?t=626724
[4]. DebianHelp - Centralized Syslog Server Using syslog-NG with web Interface using php-syslog-ng
http://www.debianhelp.co.uk/syslog-ng.htm

No comments: