Dell Networking SONiC 如何設定交換器,將記錄傳送至 syslog 伺服器
Summary: 本文說明如何設定 Dell Networking SONiC 交換器,以將記錄傳送至 syslog 伺服器。本文使用執行 Dell SONiC 4.1 的交換器。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
先決條件 我們使用標準介面命名來展示概念。請參閱文章 Dell Networking S 系列:基本介面組態 – SONIC 4.0, 以取得介面命名的詳細資訊 |
指數
介紹
設定系統記錄伺服器
範例組態
範例輸出
簡介
根據預設,系統不會將 Syslog 訊息傳送至任何伺服器。若要將 Syslog 訊息儲存在遠端伺服器中,您可以設定系統將系統記錄傳送至遠端伺服器。您也可以設定選用的來源介面,讓系統可以使用該介面的 IP 位址作為來源 IP 位址。如果您未設定來源介面,系統會使用連出介面的介面 IP 位址作為來源 IP 位址。如果介面包含一個以上的 IP 位址,系統會使用主要 IP 位址。
Dell SONiC 仰賴 UDP 將記錄訊息傳輸至 syslog 伺服器。依預設,Dell SONiC 會使用 UDP 埠 514 作為目的地埠,將 syslog 訊息傳送至伺服器。
設定系統記錄伺服器
若要設定遠端 Syslog 伺服器,請使用此全域命令。 Add a syslog server
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)#logging server {hostname | ip-address | ipv6-address} [source-interface interfacetype] [remote-port port-number] [vrf vrf-name] [message-type type] [severity level]
[vrf vrf-name] |
說明
|
Remove syslog server
DELLSONiC# configure
DELLSONiC(config)# no logging server {hostname | ip-address | ipv6-address} |
範例組態
下列範例可設定系統將 Syslog 訊息傳送至 10.59.142.126。
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# logging server 10.59.142.126 |
下列範例可設定系統將 Syslog 訊息傳送至 10.59.142.125,併發生嚴重程度錯誤。
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# logging server 10.59.142.130 severity error |
下列範例可設定系統將 Syslog 訊息傳送至 10.59.143.28,並以回送 1 作為來源介面,以及從 VRF1 傳送。
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# logging server 10.59.143.28 source-interface Loopback 1 vrf Vrf1 |
下列範例可設定系統以 Eth1/1 作為來源介面,將 Syslog 訊息傳送至 10.59.136.33。
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# logging server 10.59.136.33 source-interface Eth1/1 |
範例輸出
使用命令顯示記錄伺服器 以查看 syslog 伺服器 DELLSONiC# show logging servers -------------------------------------------------------------------------------------- HOST PORT SOURCE-INTERFACE VRF MESSAGE-TYPE SEVERITY -------------------------------------------------------------------------------------- 10.59.136.33 514 Eth1/1 - log notice 10.59.142.126 514 - - log notice 10.59.142.130 514 - - log error 10.59.143.28 514 Loopback1 Vrf1 log notice |
Affected Products
PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON, PowerSwitch Z9432F-ONArticle Properties
Article Number: 000218235
Article Type: How To
Last Modified: 06 Oct 2023
Version: 2
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.