配置華為交換器把日誌發送到遠程centos syslog伺服器上

來源:互聯網
上載者:User

標籤:華為 交換器 log syslog

huawei switch:

#指定發送訊息基本,表示從0-7都發送

info-center source default channel 2 log level debugging

#指定從哪個介面發送

info-center loghost source Vlanif1

#指定遠程syslog伺服器ip

info-center loghost x.x.x.x


Centos Server:

vim /etc/rsyslog.conf

#啟用udp 514連接埠監聽。

$ModLoad imudp

$UDPServerRun 514

#把來自兩個交換器的日誌分別放入到指定的log檔案中。

:fromhost-ip,isequal, "x.x.x.x"              /var/log/switch01.log

:fromhost-ip,isequal, "x.x.x.x"              /var/log/switch02.log

#重啟rsyslog服務

service rsyslog restart


測試:

在交換器上執行任何命令都被記錄下來,比如:

#tail -f /var/log/switch01.log

May  5 16:17:27 switch01 %%01SHELL/6/DISPLAY_CMDRECORD(s)[1]: Recorded display command information. (Task=VT0, Ip=x.x.x.x, VpnName=, User=**, AuthenticationMethod="Password", Command="display info-center statistics")

May  5 16:17:40 switch01 %%01SHELL/6/DISPLAY_CMDRECORD(s)[2]: Recorded display command information. (Task=VT0, Ip=x.x.x.x, VpnName=, User=**, AuthenticationMethod="Password", Command="display current-configuration")


配置華為交換器把日誌發送到遠程centos syslog伺服器上

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.