想你了的他他 发表于 2018-7-13 06:47:36

Cisco网络设备的SNMP及Syslog配置参考

设置IOS设备  在IOS的Enable状态下,敲入
  config terminal 进入全局配置状态
  Cdp run 启用CDP
  snmp-server community gsunion ro 配置本路由器的只读字串为gsunion
  snmp-server community gsunion rw 配置本路由器的读写字串为gsunion
  snmp-server enable traps 允许路由器将所有类型SNMP Trap发送出去
  snmp-server host IP-address-server traps trapcomm 指定路由器SNMP Trap的接收者为10.238.18.17,发送Trap时采用trapcomm作为字串
  snmp-server trap-source loopback0 将loopback接口的IP地址作为SNMP Trap的发送源地址
  logging on 起动log机制
  logging IP-address-server 将log记录发送到10.238.18.17 (CW2K安装机器的IP地址)上的syslog server
  logging facility local7 将记录事件类型定义为local7
  logging trap warning 将记录事件严重级别定义为从warningl开始,一直到最紧急级别的事件全部记录到前边指定的syslog server.
  logging source-interface loopback0 指定记录事件的发送源地址为loopback0的IP地址
  service timestamps log datetime 发送记录事件的时候包含时间标记
  enable password ******
  line tty 0 4
  password ******
  login local 设置Enable口令和Telnet口令
  show running
  copy running start或write terminal 显示并检查配置
  保存配置
  设置CatOS设备
  在CatOS的Enable状态下,敲入

  set interface sc0 VLAN>  Set cdp enable all 启用CDP
  set snmp community read-only gsunion 配置本交换机的只读字串为public
  set snmp community read-write-all gsunion 配置本交换机的读写字串为private
  set snmp trap server-ip gsunion 指定交换机SNMP Trap的接收者为网管服务器,发送Trap时采用gsunion作为字串
  set snmp trap enable all 将全部类型的SNMP Trap发送出去
  set snmp rmon enable 激活交换机的SNMP RMON功能
  set logging server IP-address-server 将log记录发送到网管服务器的IP (CW2K安装机器的IP地址)上的syslog server
  set logging level 6 将记录事件严重级别定义为从informational开始,一直到最紧急级别的事件全部记录到前边指定的syslog server
  set logging server facility local7 将记录事件类型定义为local7
  set logging timestamp 发送记录事件的时候包含时间标记
  set logging enable 起动log机制
  set password ******
  set enablepass ******
  设置Enable口令和Telnet口令
  show running
  write terminal 显示并检查配置
  保存配置
  配置PIX设备
  Logging on 在PIX上面启用日志记录
  Snmp-server community gsunion 为PIX设备配置共同体串gsunion
  Snmp-server enable traps 配置PIX设备将SNMP消息发送到网管服务器
  Snmp-server host server-ip 在PIX设备上面配置SNMP网管服务器
  Logging history warning
  为PIX设备SNMP系统日志消息设置warning级别。
页: [1]
查看完整版本: Cisco网络设备的SNMP及Syslog配置参考