| tactic 回复于:2002-11-20 17:56:21 |
| 按理说不会阿,几个地方确认一下 1.logging on ? show logging?ping得通吗? 2. ps -ef | grep syslogd ? 3.一般是写在var/log下的吧,下面是Cisco的例子 /etc/syslog.conf file: # Added for Cisco Syslog Analyzer (begin) local7.info /var/log/syslog_info # Added for Cisco Syslog Analyzer (end) #BEGIN CSCOmd - DO NOT EDIT THESE COMMENTS OR CONTENTS CONTAINED WITHIN - local0 1 # local0.emeerg;local0.alert;local0.crit;local0.err;local0.warning;local0.notice;local0.info;local0.debug /var/adm/CSCOpx/log/dmgtd.log # #END CSCOmd DO NOT EDIT BEFORE THIS LINE 1 :21: |
| sunnycn 回复于:2002-11-20 18:04:46 |
| 那么麻烦! 我记得有一片文档,在google里搜的。给这种现象有点类似! |
| coolbid 回复于:2002-11-20 18:30:19 |
| 那位高手给详细解释一下,我也搞不懂 |
| tomduanj 回复于:2002-11-20 20:30:26 |
| 妈的,问题真是越来越奇怪,我现在不在/etc/syslog.conf中添加,而是修改它的内容,在 *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages 中增加了一个local0.* *.err;kern.debug;daemon.notice;local0.*;mail.crit /var/adm/messages 加了以后,重新启动syslog服务,再用logger向syslog中发信息,居然就没有记录,真是搞不懂solaris的syslog怎么这么莫名其妙,这么敏感,我稍微修改了一点东西就不行 # tail /var/adm/messages Nov 20 17:49:02 erp syslogd: going down on signal 15 Nov 20 17:49:57 erp syslogd: going down on signal 15 Nov 20 17:50:06 erp syslogd: going down on signal 15 Nov 20 17:54:20 erp syslogd: going down on signal 15 Nov 20 17:55:21 erp shell: [ID 702911 daemon.notice] adfafd Nov 20 17:57:57 erp shell: [ID 702911 daemon.error] adfadfasdf Nov 20 17:59:38 erp shell: [ID 702911 mail.crit] 13477327 Nov 20 18:01:22 erp syslogd: going down on signal 15 Nov 20 20:03:30 erp shell: [ID 702911 daemon.notice] adljfklajdsklfjalkj Nov 20 20:05:01 erp syslogd: going down on signal 15 # ps -A|grep syslog 8167 ? 0:00 syslogd # /etc/init.d/syslog stop # /etc/init.d/syslog stop # /etc/init.d/syslog start syslog service starting. # /usr/bin/logger -p daemon.notice "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # tail /var/adm/messages Nov 20 17:49:02 erp syslogd: going down on signal 15 Nov 20 17:49:57 erp syslogd: going down on signal 15 Nov 20 17:50:06 erp syslogd: going down on signal 15 Nov 20 17:54:20 erp syslogd: going down on signal 15 Nov 20 17:55:21 erp shell: [ID 702911 daemon.notice] adfafd Nov 20 17:57:57 erp shell: [ID 702911 daemon.error] adfadfasdf Nov 20 17:59:38 erp shell: [ID 702911 mail.crit] 13477327 Nov 20 18:01:22 erp syslogd: going down on signal 15 Nov 20 20:03:30 erp shell: [ID 702911 daemon.notice] adljfklajdsklfjalkj Nov 20 20:05:01 erp syslogd: going down on signal 15 信息没有写进去,天啊,我欲哭无泪啊 |
| 段誉 回复于:2002-11-20 21:06:38 |
| 你的/etc/hosts文件中,loghost这个主机名有吗?指向的是你的实际主机地址,而不是127.0.0.1吗? |
| tomduanj 回复于:2002-11-20 21:08:24 |
| # more /etc/hosts # # Inte.net host table # 127.0.0.1 localhost 10.137.201.141 erp loghost |
| tomduanj 回复于:2002-11-20 21:12:26 |
| 妈的,我现在在两台机器上都做了,一个是150,一个是450的机器,几乎都是上周才装的5。8,系统不可能有问题,结果现在出的问题一样,都没办法记录路由器的日志信息,真不知道问题出在哪里 |
| 段誉 回复于:2002-11-20 21:16:13 |
| 最后一行: local0.* ifdef('LOGHOST',/var/adm/cisco,@loghost) |
| tomduanj 回复于:2002-11-20 21:40:20 |
| 奇怪,奇怪,真奇怪,现在我发现问题越来越有意思了,现在不讨论什么记录路由器日志的事情了,我发现连本身服务器自己的日志记录都有问题,我的/etc/syslog.conf中对应/var/adm/messages的是这么一句 *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages 但是我用/usr/bin/logger 测试的结果却是/var/adm/messages中只记录daemon.notice和mail.crit的信息,kern.debug的却不记录,并且对此行添加点别的东西后连daemon.notice都不记录了, 在/etc/syslog.conf最后写一行daemon.notice /var/adm/cisco 然后用logger测试,发现cisco文件中居然有了记录 |
| mmmmn 回复于:2002-11-20 21:44:00 |
| 看看是不是格式问题吧 |
| tomduanj 回复于:2002-11-20 21:48:11 |
| 妈了个呸,搞定了 |
| sunmarmot 回复于:2002-11-21 00:09:54 |
| up一下,到底问题出在哪里?? |
| tomduanj 回复于:2002-11-21 09:53:41 |
| 看看若关心此问题的人多,我就把方法写上来 |
| sunmarmot 回复于:2002-11-21 10:03:51 |
| 你贴啊,怎怎么总吊人胃口~~~~~~~~~~~~` |
| gp 回复于:2002-11-21 10:06:10 |
| 关心 |
| laoxia 回复于:2002-11-21 10:10:29 |
| 强烈要求贴出来。 |
| ultra-guest 回复于:2002-11-21 10:10:50 |
| ...... |
| tomduanj 回复于:2002-11-21 10:17:46 |
| 我在整理,一会就贴出来 |
| tomduanj 回复于:2002-11-21 10:40:05 |
| 奇怪,我发现solaris居然对telnet失败的登陆没有日志记录,而linux是可以做到的 |
| tomduanj 回复于:2002-11-21 11:02:50 |
| 須注意的是所有高於或等於SELECTOR中指定的priority事件所產生的訊息,都將會被syslogd依據對應ACTION的指定方式,記錄在系統中。例如mail.notice包含了mail facility所產的notice、warn、err、crit、alert及panic的事件訊息。 至於實際上什麼樣的事件該歸屬於哪一個facility的哪一個priority,則會隨UNIX種類的不同,而有小幅度的差異。例如tcpd的訊息在Sun Solaris系統中,屬於mail.info,在Slackware Linux中屬於auth.info,RedHat Linux則是屬auth_priv.info。這些差異有時候需要管理者花一些時間去找出來。 |
| laixi 回复于:2002-11-21 11:05:26 |
| 能把你最后的配置文件贴一下吗 |
| laoxia 回复于:2002-11-21 11:27:36 |
| 兄弟能不能把 文件里改动那一段贴一下?我好学一点东西? |
| tomduanj 回复于:2002-11-21 13:22:15 |
| 我在配置solaris服务器来做路由器的日志服务器时,由于solaris与linux的syslog的不同,吃了大苦头,:-(,不过最后还是自己搞定了,特地把教训写在这里。 facility solaris user,kern,mail,daemon,auth,lpr,news,uucp,cron,local0-7,mark,* linux user,kern,mail,daemon,auth,lpr,news,uucp,cron,local0-7,mark,*, authpriv,security (same as auth),syslog level solaris emerg,alert,crit,err,warning,notice,info,debug,none linux emerg,alert,crit,err,warning,notice,info,debug,none,* warn (same as warning),error (same as err), panic (same as emerg) 看到没有,在solaris中的level中,对通配符"*"是不认的(虽然在facility中认的),我就是载在这个上面了。TMD,看来solaris的交互性远没有linux的友好。 也就是说,在linux中,你这么写syslog.conf local0.* /var/log/cisco 是没有问题的,但在solaris中是不行的,系统会把这行认为是错误的,忽略掉,必须老老实实的按步就班的写 local0.debug /var/adm/cisco 才可以啦 哈哈,看到了,说穿了一钱不值,让我花了三天时间折腾,幸亏没有去重装系统. 不过另外还有问题,我在linux 上写 auth.*;authpriv.* /var/log/authlog 可以记录任何对系统的登陆信息,用户端telnet 出来要用户名的时候,我的日志就有了,并且是输入了几次错误的口令都有记录,但在solaris中就不同, syslog.conf内容 auth.emerg;auth.alert;auth.crit;auth.err;auth.warning;auth.notice;auth.info;auth.debug /var/adm/auth.l og 当用户telnet用户错误时的信息是 Nov 21 12:58:41 erp login: [ID 427203 auth.debug] pam_authenticate: error Authentication failed 居然没有对方的IP地址信息 当su为root时的信息 Nov 21 13:00:32 erp su: [ID 810491 auth.crit] 'su root' failed for shell on /dev/pts/7 也没有对方的IP地址信息 不会这么若吧,是不是我的配置不对,还是solaris就是这样? |
| sunmarmot 回复于:2002-11-21 13:41:14 |
| hohoho!!!!up |
| mmmmn 回复于:2002-11-21 13:41:23 |
| ok,讨论一下 |
| xa-yy 回复于:2002-11-21 13:45:57 |
| [quote][b]下面引用由[u]sunmarmot[/u]在 [i]2002/11/21 10:03am[/i] 发表的内容:[/b] 你贴啊,怎怎么总吊人胃口~~~~~~~~~~~~` [/quote] |
| lq 回复于:2002-11-21 14:05:17 |
| 我再/etc/syslog.conf中加入如下 auth.notice /var/log/authlog 登陆失败后再/var/log/authlog中记录 Nov 21 13:45:43 servera login: REPEATED LOGIN FAILURES ON /dev/pts/5 FROM 10.18. 3.10 |
| laoxia 回复于:2002-11-21 15:19:54 |
| 谢Tom,不折不扣的好贴。 加一点:由缺省,SOLARIS 确实没有IP 地址的追踪功能。 须配/etc/init.d/inetsvc ( 系统网络功能的启动脚本)。 把这行加一个 " -t " 选项: /usr/sbin/inetd -s & 变为 /usr/sbin/inetd -s -t & 然后run, pkill -HUP inetd |
| tomduanj 回复于:2002-11-21 15:29:38 |
| 奇怪,我的日志信息里没有IP地址信息啊 |
| tomduanj 回复于:2002-11-21 15:33:22 |
| 谢laoxia鼓励,呵呵,不枉我写了半天,总算有人捧场。 另外,我想记录任何人 telnet或ssh登陆solaris系统的记录,不知道 solaris可以做否,我在linux上是可以实现的。 |
| tomduanj 回复于:2002-11-21 15:57:31 |
| 修改了/etc/init.d/inetsvc文件后重新启动inetd 没有效果啊 ps -aef|grep inetd root 175 1 0 Nov 18 ? 0:01 /usr/sbin/inetd -s root 10074 10056 0 15:35:02 pts/5 0:00 grep inetd 结果在/var/adm/auth.log中仍旧没有对方地址出来,并且不是每次用户名认证一次就有一条记录的 |
| milan 回复于:2002-11-21 17:51:11 |
| vi /etc/init.d/inetsvc 最后一行改成这样 /usr/sbin/inetd -s -t & 然后/etc/init.d/inetsvc stop再start就行了 -t就是加了个trace的作用。 这是登录信息: Nov 21 17:28:03 e250 inetd[519]: [ID 317013 daemon.notice] telnet[522] from 192. 168.0.198 3492 另外你刚才说起来我倒想起来了,syslog的level确实是不能用*的,当时咋就没想起来呢?呵呵 |
| 南非蜘蛛 回复于:2002-11-21 19:09:49 |
| [这个贴子最后由南非蜘蛛在 2002/11/21 07:10pm 编辑] 不是不能用*,而是因为在solaris里,可以使用*选择所有事件(除了mark事件),但是不能使用*选择所有的级别,一般都是按自己需要的level去定义 |
| boot 回复于:2002-11-22 09:11:08 |
| 蜘蛛回来了! |
| firebird 回复于:2002-11-22 10:50:03 |
| 在cisco的安全等级定义中,如emerg,alert,crit,err,warning,notice,info,debug,后面的安全等级包括了前面的安全等级,也就是说,当你定义了debug等级,那么它将发送所有的前面的安全等级信息到syslog服务器,所以solaris能够记录所以的安全事情,而当你用了*号,结果就不一定了. |
| ravenhua 回复于:2002-11-22 15:03:43 |
| 在solaris系统管理的书中写得很明白,syslog只认 *.debug等的格式,而不认 auth.* 的格式,所以你的 local0.* 在solaris系统中肯定是错误的。 |
| abao22 回复于:2002-11-22 15:21:51 |
| [这个贴子最后由abao22在 2002/11/22 03:27pm 编辑] |
| tomduanj 回复于:2002-11-22 17:01:20 |
| call,现在大家都明白了,solaris 的通配符*只能用在 facility中,而level是不行的,而在linux中是都可以的 |
| monkeysun 回复于:2002-12-12 11:57:41 |
| Configuring the /etc/syslog.conf File A configuration entry in the /etc/syslog.conf file consists of two tab-separated fields: selector and action. The selector field consists of a facility and a level written as facility.level. Facilities represent categories of system processes that can generate messages. Levels represent the severity or importance of the message. The action field determines where to send the message. For example, placing the following entry in the /etc/syslog.conf file causes error messages for all facilities to be sent to the /var/adm/messages file: *.err /var/adm/messages where *.err Is the selector field; * is the facility, . is the delimiter, and err is the level of the message /var/adm/messages Is the action field Caution – Only use tabs as white space in the /etc/syslog.conf file. Selector Field The selector field is a semicolon-separated list of priority specifications of the form: facility.level; facility.level. Facility is a system facility that is defined by the items shown in Table 3-1. <font color="red" face="arial"><b> Note – You can use the * to select all facilities (for example *.err); however, you cannot use it to select all levels for a facility (for example, kern.*)</b></font> ---------------------------------------- SA228 3-6 |
| 非凡公子 回复于:2002-12-12 12:21:07 |
| 我的syslog.conf 中是這樣寫的 auth.notice ifdef(`LOGHOST', /var/log/authlog, @loghost) cat /var/log/authlogDec 12 12:16:06 yt168sun220 sshd2[578]: [ID 702911 auth.notice] Password authentication for user root aclearcase/" target="_blank" >ccepted. Dec 12 12:16:06 yt168sun220 sshd2[578]: [ID 702911 auth.notice] User root, coming from 192.168.0.19, authenticated 系統為solaris 8 sparc,記錄了IP了呀 |
| doffinee 回复于:2002-12-12 18:21:05 |
| 老大啊,Solaris本来就是这样的,*只能用来指facility的,Level是禁止--这个在manual里面很清楚的。 呆了大家那么长时间的胃口, 唉 ~ |
| phoenixli 回复于:2002-12-12 18:29:19 |
| 小问题咯~~~不值当D~~~ |
| dblife 回复于:2002-12-18 17:20:57 |
| just a test |
| ericyi 回复于:2002-12-18 22:25:57 |
| 楼上的老兄,你怎么这样的呀。我曾经在linux下也没有成功,恳请能赐教。 |