转自 [url]http://hi.baidu.com/aruistation/blog/item/d169b1c3c09b0c54b219a86f%2Ehtml[/url]
第一篇::
1syslog如何工作
Cisco PIX防火墙中的syslog消息部件是观察对消息的疑难解析和观看诸如***和拒绝服务等网络事件的一个有效的方法。Cisco PIX防火墙经由syslog消息报告下列事件和行为:
   系统状态:记录Cisco PIX防火墙何时重新启动,以及经由telnet或者控制台的连接何时开始或断开
   审计信息:每次连接传送的字节数目
   安全:丢弃的UDP分组和被拒绝的TCP连接
   资源:连接和转换槽损耗的通知
  
syslog消息可以被发送至位于和不位于PIX单元的多个不同的输出目的地:
PDM日志
控制台
内存缓冲区
Telnet控制台
Syslog服务器
SNMP管理工作站
*在决定将syslog消息发送至何处之后,还不得不决定想要在输出目的地看到何种类型的消息
*所有的syslog消息有一个安全级别,然而并不要求所有的syslog消息有一个相应的部件
   1.1 日志部件
        当syslog消息被发送到服务器时,指示pix将通过什么管道(pipe)发送消息是很重要的,其使用管道来决定将基于信息到达的管道的输入信息发送到 何处,也就是写道哪个文件中去的管道.单个的syslog服务,如syslogd,可以被认为拥有多个管道.
       通常有8个日志部件(16~23)用于PIX上的syslog.在syslog服务器上,部件号码有一个对应的表示(local0~local7),缺省部件为local4(20),要改变PIX上的缺省日志部件.
      pix(config)#logging facility 21
   1.2 日志级别
      请查看日志严重性级别
      很多logging命令要求指定一个严重性级别阀值来指定那些syslog消息可以被发送至输出位置.
      级别号越低,syslog消息越严重。缺省的严重性级别为3(错误)
      *所指定的级别使得Cisco PIX防火墙发送该级别和低于该级别的消息至输出位置.eg如果指定严重性级别3(错误),PIX发送0(emergency),1(alert),2(critical),3(error)消息至输出目的地
    1.3配置cisco pix防火墙的syslog
        查看logging命令参数
         1.3.1 配置PDM来观察日志 system properties->logging
         1.3.2 在控制台配置syslog消息
                 在pix防火墙中使用logging console命令来发送syslog消息至控制台界面
                 pix(config)#logging on
     pix(config)#logging console 5 5指出了日志级别
                 pix(config)#show logging   ------->pix(config)#clear logging     clear messages in the logging buffer    
                 pix(config)#no logging console------>   disable logging to the console
         1.3.3 查开一个telnet控制台会话的消息
                 使用logging monitor命令来配置pix以发送syslog消息至telnet会话.
                 pix(config)#logging monitor 6
                 pix(config)#terminal monitor
                 pix(config)#no logging monitor ------>disable logging to the telnet
         1.3.4配置cisco pix防火墙以发送syslog消息到log服务器上
      pix(config)#logging host inside 10.1.1.10--->用logging host 命令标明接收消息的主机
      pix(config)#logging trap informational--->用logging trap命令设置日志级别
      *如果所有的syslog服务器都离线了,cisco PIX会存储100条消息在其内存中,后续达到的消息将从第一行开始覆盖缓冲区中已有的消息.
      pix(config)#logging on----->要使消息停止发送,使用no logging命令.
      关于配置syslogd和pfss服务器,请上cisco 查看
    1.4配置SNMP陷阱和SNMP请求
        SNMP请求可以用来询问pix的系统状况消息,SNMP陷阱仅仅在到达配置阀值时发送关于特定事件的消息.
     配置pix接收来自一个管理站的SNMP请求:
     使用snmp-server host命令配置SNMP管理站的ip 地址
     将snmp-server选项设置为location,contact,以及按要求设置community口令
     配置SNMP陷阱:
         使用snmp-server host命令配置SNMP管理站的ip 地址
         将snmp-server选项设置为location,contact,以及按要求设置community口令
         使用snmp-server enable traps命令设置陷阱
         使用logging history命令设置日志级别
   %PIX-Level-message_number:message_test
pix为pix防火墙产生的消息标示消息部件代码
lebel,所描述消息的严重界别,数字越小,情况越严重
message_number,唯一指定消息的数字代码
message_test:线性的描述情形的正文.消息的这一部分有时候包括IP地址,端口号
第二篇::
PIX Software中的Syslog配置
========phanx.cn=========
Author:    phanx
Updated: 2006-10-18
=========================
Syslog默认采用 UDP的514端口。
PIX Software 6.3.x 中支持对 syslog 的协议的定制。
logging host x.x.x.x y/z
其中 x.x.x.x 为 syslog server的IP。 y 为协议号 6是 TCP, 17 是UDP, z 是端口号

也就是说PIX支持TCP方式的Syslog。
但是,需要特别注意的就是,如果采用 TCP Syslog的话一定要确保
syslog server工作正常,如果pix检测到 tcp syslog server异常,
那么pix就会中断现有的流量。
Cisco 配置手册中的原文:
---------------------------------------
Note:
Because this traffic is TCP (that is, with acknowledgments),
if the PFSS goes down,
traffic through the PIX stops. For this reason, the tcp syslog command should
not be implemented unless you need this kind of functionality.
---------------------------------------
UDP/514 syslogging does not have this effect.
---------------------------------------
PFSS - PIX Firewall Syslog Server

今天某一重要用户的PIX 520就出现了这种情况,由于 Syslog服务器被其它的原因弄崩溃了
导致PIX 520中断经过的所有流量。
当时PIX的show logging buffer 中全部是这个日志:
%PIX-3-201008: The PIX is disallowing new connections.
Log 解释如下:
Error Message %PIX-3-201008: The PIX is disallowing new connections.
Explanation
This message occurs when you have enabled TCP system log messaging
and the syslog server cannot be reached, or when using
PIX Firewall Syslog Server (PFSS) and the disk on the Windows NT system is full.
Recommended Action
Disable TCP system log messaging.
If using PFSS, free up space on the Windows NT system where PFSS resides.
Also, make sure that the syslog host is up and you can ping the host from the
PIX Firewall console.
Then restart TCP system message logging to allow traffic.
所以大家切记,没事别开 TCP Syslog。
第三篇是原创了 嘿嘿嘿嘿。。。
logging on
logging timestamp
logging monitor alerts
logging buffered informational
logging trap informational
logging history informational
logging host uplink 211.97.168.73
no logging message 106015
no logging message 106010
no logging message 106011
no logging message 106002
no logging message 106023
no logging message 106021
no logging message 305012
no logging message 305011
no logging message 302015
no logging message 302014
no logging message 302013
no logging message 302016
配置片断,no掉这些错误号后日志文件会减少好多,免得撑破你的硬盘。。