SYSLOG标准配置举例

王朝other·作者佚名  2008-05-31
宽屏版  字体: |||超大  

It sends SYSLOG to a Linux Box

gw#conf t

gw(config)#logging on

gw(config)#logging 192.168.0.2

gw(config)#logging facility local1

gw(config)#logging source-interface e0

Change formats of date, save log into memory. See by "sh logging"

gw(config)#timestamps log datetime msec localtime

gw(config)#service timestamps debug uptime

gw(config)#logging buffered 8192 debugging

Edit /etc/sysconfig/syslog (RedHat7.2) to accept syslog messages remotely

SYSLOGD_OPTIONS="-m 0 -r"

Edit /etc/syslog.conf and add one line as below

...

local1.* /var/log/gw.log

Edit /etc/logrotate.d/syslog to lotate /var/log/gw.log file

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boo

t.log /var/log/cron /var/log/gw.log {

sharedscripts

postrotate

/bin/kill -HUP `cat /var/run/syslogd.pid 2 /dev/null` 2 /dev/null t

rue

endscript

}

Restart Syslog

# /etc/init.d/syslog restart

Shutting down kernel logger: [ OK ]

Shutting down system logger: [ OK ]

Starting system logger: [ OK ]

Starting kernel logger: [ OK ]

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有