Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell Networking SONiC 系统日志消息和审核日志

Summary: 本文介绍 Dell Networking SONiC 交换机中的系统消息和审核日志。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Instructions

指数

系统日志
审核日志

系统日志

什么是系统日志?

系统日志文件或系统日志是交换机中各种进程中所有已启用日志记录的事务记录。系统上针对重大事件生成系统日志警报。其中包括内存利用率、磁盘分区利用率、CPU 阈值等事件。

默认情况下,系统日志处于启用状态。此信息可帮助交换机管理员对与交换机和网络相关的问题进行故障排除。

日志消息根据严重性级别进行分类。

日志消息级别包括:
 
严重性级别 级别
调试 7
信息 6
通知 5
警告 4
错误 3
严重 2
警报 1
紧急 情况 0


如何查看系统日志消息

可以使用以下命令查看 Dell Networking SONiC 系统日志:

示例输出
show logging

DELLSONiC# show logging
Jul 04 17:22:05.528854+00:00 2023 sonic NOTICE syncd#syncd: :- setPort: setting admin UP on eth1 Eth1/1 portId oid:0x100000001
Jul 04 17:22:05.531292+00:00 2023 sonic NOTICE l2mcd#l2mcmgrd: :- doL2McInterfaceUpdateTask: L2MCD_CFG: IF:Eth1/1 op:SET oper:0
Jul 04 17:22:05.535991+00:00 2023 sonic NOTICE l2mcd#Logs: l2mcd_port_list_update PortInfo RX: Eth1/1, ifidx:4096 oper:1 is_add:1 is_lag:0, kif:29 rx_sock:56
Jul 04 17:22:05.536061+00:00 2023 sonic NOTICE syncd#syncd: :- syncOnLinkMsg: newlink: ifindex: 3, ifflags: 0x1103, ifname: eth1
Jul 04 17:22:05.536185+00:00 2023 sonic NOTICE syncd#syncd: :- asyncOnLinkMsg: received RTM_NEWLINK ifname: eth1, ifflags: 0x11143, ifindex: 3
Jul 04 17:22:05.537401+00:00 2023 sonic NOTICE swss#orchagent: :- doTask: Get port state change notification id:1000000000002 status:1
Jul 04 17:22:05.537401+00:00 2023 sonic NOTICE swss#orchagent: :- updatePortOperStatus: Port Eth1/1 oper state set from down to up


如何查看系统日志消息计数

Dell SONiC 存储大量日志消息。要查看日志消息的数量,请使用以下命令:
输出示例
show logging count

DELLSONiC# show logging count
438


如何查看最新的系统日志消息

通常,查看最新的日志消息非常有用。使用以下命令查看消息:

输出示例
show logging lines 

DELLSONiC# show logging lines 3
Jul 04 17:24:18.550108+00:00 2023 sonic NOTICE syncd#syncd: :- process_packet_for_fdb_event: Learn New MAC V:1 P:1/0/0
Jul 04 17:24:18.550108+00:00 2023 sonic WARNING syncd#syncd: :- findBridgeVlanForPortVlan: failed to find bv_id for vlan 1 and port_id oid:0x100000001
Jul 04 17:24:18.550108+00:00 2023 sonic WARNING syncd#syncd: :- process_packet_for_fdb_event: skipping mac learn for {"bvid":"oid:0x0","mac":"00:00:5E:00:01:01","switch_id":"oid:0x2100000000"}, since BV_ID was not found for mac


如何查看具有特定模式的日志消息

您可以通过 grep ( | ) 搜索指定模式的日志消息。使用以下命令执行 grep:

在下面的示例中,我们将查看具有模式 Eth1/1 的日志消息。

输出示例
show logging | grep 

DELLSONiC# show logging | grep Eth1/1
Jul 04 17:22:01.141637+00:00 2023 sonic NOTICE l2mcd#l2mcmgrd: :- doL2McInterfaceUpdateTask: L2MCD_CFG: IF:Eth1/1 op:SET oper:0
Jul 04 17:22:01.142410+00:00 2023 sonic NOTICE l2mcd#l2mcmgrd: :- doL2McInterfaceUpdateTask: L2MCD_CFG: IF:Eth1/1 op:SET oper:0
Jul 04 17:22:01.142410+00:00 2023 sonic NOTICE l2mcd#Logs: l2mcd_port_list_update PortInfo RX: Eth1/1, ifidx:4096 oper:0 is_add:1 is_lag:0, kif:29 rx_sock:56
Jul 04 17:22:01.151251+00:00 2023 sonic NOTICE macsec#hostapdmgrd: :- processHostapdConfigPortTblEvent: Received Eth1/1 as key and SET as OP


如何向远程系统日志服务器发送日志消息

Dell SONiC 可以将系统日志发送到远程服务器。使用以下命令:

在 bellow sample 命令中,我们将日志消息发送到远程 syslog-server 192.168.1.10。如果要指定主机名,请确保配置名称服务器。

输出示例
logging server 

DELLSONiC#
DELLSONiC# configure terminal
DELLSONiC(config)# logging server 192.168.1.10
您还可以指定端口号、源接口、严重性或 vrf。


如何清除系统日志

要清除系统日志文件,请使用以下命令:

输出示例
clear logging

DELLSONiC# clear logging
 

审核日志

什么是审核日志?

Dell SONiC 交换机中的所有用户活动(如登录、配置更改)都会记录在审核日志中。执行安全审核时,审核日志非常方便。

审核日志记录以下内容:
  • 用户使用 SSH 或控制台登录和注销
  • 所有 show 命令和配置都使用 Dell SONiC CLI、gNMI 和 REST API 操作运行。

如何查看审核日志

使用以下命令查看审核日志

示例输出
show audit-log

DELLSONiC# show audit-log
Jul 04 17:31:40.664313+00:00 2023 DELLSONiC INFO mgmt-framework#sonic-cli: User "admin" command "exit" status - success
Jul 04 17:31:32.701465+00:00 2023 DELLSONiC INFO mgmt-framework#sonic-cli: User "admin" command "exit" status - success
Jul 04 17:31:31.206452+00:00 2023 DELLSONiC INFO mgmt-framework#sonic-cli: User "admin" command "no shutdown" status - success
Jul 04 17:31:29.227217+00:00 2023 DELLSONiC INFO mgmt-framework#sonic-cli: User "admin" command "interface Eth1/1" status - success
Jul 04 17:31:25.474110+00:00 2023 DELLSONiC INFO mgmt-framework#clish[161]: User "admin" command "configure terminal" status - success
Jul 04 17:31:23.480896+00:00 2023 DELLSONiC INFO mgmt-framework#clish[161]: User "admin" command "startup" status - success
Jul 04 17:31:23.455134+00:00 2023 DELLSONiC INFO mgmt-framework#sonic-cli: message repeated 2 times: [ User "admin" command "exit" status - success]
Jul 04 17:31:19.567044+00:00 2023 DELLSONiC INFO login[21895]: pam_unix(login:session): session opened for user admin by LOGIN(uid=0)

我们可以从上述输出中看到,用户管理员在 7 月 4 日 17:31 关闭界面 Eth1/1。


如何清除审核日志。

使用以下命令清除审核日志:

示例输出
clear audit-log

DELLSONiC# clear audit-log
我们可以看到清除审核日志,第一个条目显示审核日志已清除和时间
DELLSONiC# show audit-log
Jul 04 17:32:47.835891+00:00 2023 DELLSONiC INFO mgmt-framework#sonic-cli: User "admin" command "clear audit-log" status - success
DELLSONiC#
 
提醒:只有具有管理员角色的用户才能查看和清除审核日志。

如需进一步帮助,请参阅 Dell Support Enterprise SONiC Distribution Product Page (Dell Support Enterprise SONiC 分销产品页面 )以查看 Enterprise SONiC 用户指南发行文档或联系 Dell Technologies 支持。

Article Properties


Affected Product
Enterprise SONiC Distribution, 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 Z9100-ON, PowerSwitch Z9264F-ON , PowerSwitch Z9332F-ON, PowerSwitch Z9432F-ON, PowerSwitch Z9664F-ON ...
Last Published Date

06 Dec 2023

Version

6

Article Type

How To