首页 > 学院 > 网络通信 > 正文

SYSLOG 标准配置举例

2019-11-04 20:50:27
字体:
来源:转载
供稿:网友

  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 ]

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表