1. 程式人生 > >Cisco裝置使用Syslog伺服器的設定方法

Cisco裝置使用Syslog伺服器的設定方法

將Cisco裝置的日誌發往syslog伺服器,如下操作:

device#conf t
device(config)#logging on
device(config)#logging 172.16.86.102
device(config)#logging trap errors //日誌記錄級別,可用"?"檢視詳細內容
device(config)#logging source-interface loopback0 //日誌發出用的源IP地址
device(config)#service timestamps log datetime localtime //日誌記錄的時間戳設定,可根據需要具體配置檢驗
device#sh logging


設定完成後,最好設定一下當前交換機或路由器的時鐘。這樣在日誌伺服器上就可以看到何時產生的日誌。
switch#clock 9:48:00 21 Feb 2011

logging trap level //指定日誌訊息的級別

(0:緊急(Emergencies)
1:告警(Alerts)
2:嚴重的(Critical)
3:錯誤(Errors)
4:警告(Warnings)
5:通知(Notifications)
6:資訊(Informational)
7:除錯(Debugging))

syslog要考慮的主要是哪些日誌需要傳送到日誌伺服器上,即日誌等級,
使用 如下命令:

device(config)#logging trap warning //日誌記錄級別,可用"?"檢視詳細內容

? emergency—Logs only emergency events.

? alert—Logs alert and more severe events.
? critical—Logs critical and more severe events.
? error—Logs error and more severe events.
? warning—Logs warning and more severe events.
? notice—Logs notice and more severe events.
? informational—Logs informational and more severe events.
? debug—Logs all events, including debug events.


為了防止日誌量太大,一般設定成warning就行了。
閱讀(290) | 評論(0) | 轉發(0) | 給主人留下些什麼吧!~~ 評論熱議