2011年4月25日 星期一

CentOS 5.6 使用rsyslog接收外部設備的連線LOG

使用OS : CentOS 5.6


安裝套件 : rsyslog


前置作業 : 以 Juniper NetScreen-ISG 2000 為例子


登入到isg2000 > Configuration > Report Settings > Syslog 


設定好接收機器的相關設定


 


1. 安裝 rsyslog


# yum install rsyslog

 


2. 修改設定檔


# vim /etc/rsyslog.conf

$ModLoad imudp.so
$UDPServerRun 514
:fromhost-ip,isequal,"isg200 IP" /var/log/isg2000/isg_log

 


3. 關閉預設syslogd 並啟用 rsyslog


# chkconfig syslogd off
# chkconfig rsyslog on

# service syslog stop
# service rsyslog start

 


4. 設定輪替檔


# vim /etc/logrotate.conf

/var/log/isg2000/isg_log{
        daily
        create
        rotate 360
        compress
        postrotate
        /etc/init.d/rsyslog reload
        endscript
}

沒有留言:

張貼留言

如何在 golang 裡面引用 gitlab private repo

參考文章:https://stackoverflow.com/questions/27500861/whats-the-proper-way-to-go-get-a-private-repository 原文是用 gitlab.company.com 當範例,這邊改成一般帳號...