H3C配置日誌主機
- 2020 年 1 月 7 日
- 筆記
華三網絡設備信息級別共有8級,從高到底分別為emergencies/alerts/critical/errors/warnings/notifications/infomational/debugging。
|
信息級別 |
數值 |
描述 |
|---|---|---|
|
emergencies |
0 |
系統不可用信息 |
|
alerts |
1 |
需要立刻做出反應的信息 |
|
critical |
2 |
嚴重信息 |
|
errors |
3 |
錯誤信息 |
|
warnings |
4 |
警告信息 |
|
notifications |
5 |
正常出現但是重要的信息 |
|
infomational |
6 |
需要記錄的通知信息 |
|
debugging |
7 |
調試過程產生的信息 |
這裡我只整理幾條交換機上配置日誌主機時必須或者經常用到的配置命令。
info-center enable
info-center source default channel loghost debug state off log state off trap state off
info-center source default channel loghost log level informational state on //發送information以上級別的log日誌
以上兩條命令,可以配置指定日誌模塊並發送指定日誌級別,以上例子為所有模塊(default)。
info-center timestamp loghost no-year-date //將日誌格式不顯示年
這條命令可選擇日誌時間戳的格式。
info-center loghost host-ipv4-address port port-number facility local7
這條命令是設置日誌服務器地址及端口,facility命令可以設置設備信息,以便在日誌服務器上進行日誌分類。