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命令可以設置設備資訊,以便在日誌伺服器上進行日誌分類。