- 论坛徽章:
- 0
|
我昨天晚上刚装好的一台sun ultra enterprise 150(由于是刚装的服务器,服务器肯定没有问题),想做日志服务器记录路由器上的日志信息,我以前是用linux来做的,同样的路由器配置,在linux上是好的,可以记录路由器的日志,但在solaris上就死活不行,我都要疯了,
路由器配置:
logging trap debugging
logging facility local2
logging host x.x.x.x
logging x.x.x.x
solaris上的syslog.conf文件
#Log cisco7206
local2.* /var/adm/cisco7206
但cisco7206文件中就是没有东西,我后来又改为
*.* /var/adm/cisco7206
重新启动syslogd
/etc/init.d/syslog stop
/etc/init.d/syslog start
此时/var/adm/cisco7206中有系统的记录,但还是没有cisco路由器的日志信息记录
我怀疑是路由器的UDP514的信息没有发到服务器上来,
# snoop -xr port 514
Using device /dev/hme (promiscuous mode)
6.18.195.57 ->; zh SYSLOG C port=55236 <5>;11761: *Nov 18 01
0: 0800 2080 eeb1 00d0 d33c 6cb0 0800 4500 .. ......<l...E.
16: 0077 0041 0000 fe11 c98f 3d99 7311 ca60 .w.A..?..=.s..`
32: 779a d7c4 0202 0063 9d58 3c31 3e31 3137 w......c.X<5>;117
48: 3631 3a20 2a4e 6f76 2031 3120 3031 3a30 61: *Nov 18 01:0
64: 393a 3430 3a20 2553 5953 2d35 2d43 4f4e 9:40: %SYS-5-CON
80: 4149 4711 493a 2043 6f6e 6169 6775 7265 FIG_I: Configure
96: 6411 6672 6f6d 2063 6f1e 716f 6c15 2062 d from console b
112: 7110 7174 7134 2028 3210 312e 3936 2131 y vty4 (44.56.2
128: 3031 2e37 29 02.7)
很明显,网卡确实是受到了由路由器发来的SYSLOG信息,但为何没有记录到syslog进程中呢?
以上IP地址信息做了处理。
到底是什么问题呢?
然后我回过头来看,怀疑是系统的syslog本身的问题(因为我可以在服务器上抓到路由器发来的514端口的包啊),果然,我用logger向服务器自身发日志信息
,同时监看/var/adm/messages文件,在系统默认的syslog.conf配置文件下
(*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages)
,重新启动机器(我对重新启动syslog都有点怀疑了),
/usr/bin/logger -p daemon.notice "12345"
可以在/var/adm/messages中看到信息,
Nov 20 16:09:50 erp root: [ID 702911 daemon.notice] 12345
但/usr/bin/logger -p kern.debug "12345"就没有信息写到/var/adm/messages中,更别说local0了
大家帮帮忙啊,我已经折腾了3天了
我的syslog.conf的默认配置,本来大家都知道的,为了方便起见,贴在这里了
#ident "@(#)syslog.conf 1.5 98/12/14 SMI" /* SunOS 5.0 */
#
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
# syslog configuration file.
#
# This file is processed by m4 so be careful to quote (`') names
# that match m4 reserved words. Also, within ifdef's, arguments
# containing commas must be quoted.
#
*.err;kern.notice /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages
*.alert;kern.err;daemon.err operator
*.alert root
*.emerg *
# if a non-loghost machine chooses to have authentication messages
# sent to the loghost machine, un-comment out the following line:
#auth.notice ifdef(`LOGHOST', /var/log/authlog, @loghost)
mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost)
#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(`LOGHOST', ,
user.err /dev/sysmsg
user.err /var/adm/messages
user.alert `root, operator'
user.emerg *
)
local0.* /var/adm/cisco
最后一行本来是想记录路由器发来的日志信息的,但就没用,同样的设置在linux却好的很
/var/adm/cisco文件权限应该也没有问题
-rw-r--r-- 1 root other 0 Nov 20 14:11 cisco
提示关注:24/34/40楼
[ 本帖最后由 yuhuohu 于 2009-11-27 09:20 编辑 ] |
|