路由器的记录日志是如何实现的

记录日志(Logging)

路由器可以使用日志记录功能将日志记录到本地设备或发送到远端服务器

Logging buffered [size] 设置日志缓存,一般设置为4096
Show logging 查看日志
Clear logging 清除日志
Logging host 可以设置将日志发送到syslog服务器

如果要将日志发送到telnet会话 Terminal monitor
可以给日志信息加入时间 Service timestamps log datetime [msec] [localtime] [show-timezone]
Service timestamps log uptime
对于消息类型可以分级设置 Logging {console | monitor | trap | history}

Level分类如下 :

  • 0 Emergencies 系统不稳定
  • 1 Alert 需要立即采取行动
  • 2 Critical 临界情况
  • 3 Errors 错误情况
  • 4 Warnings 警告情况
  • 5 Notifications 正常但重要的情况
  • 6 Informational 仅信息消息
  • 7 debugging 调试消息

同步日志输出,减轻显示到主控台上的日志消息会打断主控台的输入

Logging synchronous 一个常见的logging配置

Syslog在路由器上的配置如下:

  1. 调整记录消息的设备类型
    Logging facility facility-type 、
  2. 将日志指定到主机将日志指定到主机
    logging 172.16.1.2 logging trap notifications
  3. 某些路由器可以支持通过SNMP发送Syslog
    snmp-server enable traps syslog
    logging history notification

猜你喜欢

转载自blog.csdn.net/qq_42197548/article/details/88215530
今日推荐