免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2609 | 回复: 1
打印 上一主题 下一主题

[Web] syslog-ng如何修改配置文件才能把netscreen和cisco等网络设备加到syslog-ng上 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-08 16:52 |只看该作者 |倒序浏览
syslog-ng已经做好,已经加入了windows的机器,如何修改配置文件才能把netscreen和cisco等网络设备加到syslog-ng上,一下是我的syslog-ng.conf配置文件,请问如何修改呢?

# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng( and syslog-ng.conf(5) for more information.
#
# 20000925 gb@sysfive.com
#
# Updated by Frank Crawford (<Frank.Crawford@ac3.com.au> - 10 Aug 2002
#         - for Red Hat 7.3
#        - totally do away with klogd
#        - add message "kernel:" as is done with klogd.
#
# Updated by Frank Crawford (<Frank.Crawford@ac3.com.au> - 22 Aug 2002
#        - use the log_prefix option as per Balazs Scheidler's email
#

options { sync (0);
          time_reopen (10);
          log_fifo_size (1000);
          long_hostnames (off);
          use_dns (no);
          use_fqdn (no);
          create_dirs (yes);
          keep_hostname (yes);
        };

source s_stream
{ unix-stream("/dev/log"; };

source s_internal
{ internal(); };

source s_kernel
{ pipe("/proc/kmsg" log_prefix("kernel: "); };

source remote { tcp(ip("10.3.5.17" port(514) keep-alive(yes)); };

source net { udp(); };

destination lpr { file("/var/log/lpr.log"; };
destination mail { file("/var/log/mail.log"; };
destination messages { file("/var/log/messages"; };
destination console { usertty("root"; };
destination mslog { file("/var/log/mslog.log";};
destination d_cisco { file("/var/log/cisco.log");};


#filter f_lpr { facility(lpr); };
#filter f_mail { facility(mail); };
#filter f_messages { level(info..emerg) and not facility(mail,lpr); };
#filter f_emergency { level(emerg); };
filter f_winauth { facility(local0); };
filter f_admin { match ("admin|Admin"); };
filter f_cisco { facility(local1); };


#log { source(src); filter(f_lpr); destination(lpr); };
#log { source(src); filter(f_mail); destination(mail); };
#log { source(src); filter(f_messages); destination(messages); };
#log { source(src); filter(f_emergency); destination(console); };
log { source(net); filter(f_winauth); filter (f_admin); destination(mslog);};
log { source(net); filter(f_winauth); destination(d_mysql);};
log { source(net); filter(f_cisco); destination(d_mysql);};
log { source(net); filter(f_cisco); destination(d_mysql);};


destination hosts { file("/var/log/HOSTS/$HOST/$FACILITY" owner(root) group(root) perm(0600) dir_perm(0700) create_dirs(yes)); };

log { source(remote); destination(hosts); };

destination d_mysql {
pipe("/tmp/mysql.pipe"
template("INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY', '$HOURMINSEC', '$PROGRAM', '$MSG' );\n") template-escape(yes));
};
log { source(s_stream);
source(s_internal);
source(s_kernel);
source(remote);
source(net);
destination(d_mysql); };
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP