Diagnostic-information Configuration
show diagnostic-information [since|count]
Section titled “show diagnostic-information [since|count]”[Command]
show diagnostic-information [since|count]
[Purpose]
Used to collect device diagnostic information.
[View]
System view
[Parameter]
| Parameter | Description |
|---|---|
| since | Collect logs and core files since the specified date |
| count | The number of logs to be collected |
[Usage Scenario]
Currently, on-site troubleshooting often requires multiple communications to check the configuration status of the on-site switches. To facilitate the collection of more information in one go, a quick maintenance command has been added to collect switch information. After executing the command, the output will be saved as a compressed file to a fixed directory /var/dump/.
[Use Cases]
sonic# show diagnostic-information count 2show system reboot-cause
Section titled “show system reboot-cause”[Command] show system reboot-cause
[Purpose] Used to view system restart reason information.
[View] System View
[Use Cases]
sonic# show system reboot-cause+------------------------------+--------------------+------------------------------+---------------+----------------+| Reboot-time | Reboot-timestamp | Reboot-reason | Reboot-user | Reboot-ip |+==============================+====================+==============================+===============+================+| Fri Mar 6 02:45:54 UTC 2026 | 1772765154 | User issued 'reboot' command | admin | 192.168.18.238 |+------------------------------+--------------------+------------------------------+---------------+----------------+show system cfgdb-event
Section titled “show system cfgdb-event”[Command] show system cfgdb-event
[Purpose] Used to view the change status of system configuration files, supporting modify/delete status.
[View] System View
[Use Cases]
sonic# show system cfgdb-event+------------------------------+-------------+-------------+--------+----------------+| Time | Timestamp | Operation | User | IP |+==============================+=============+=============+========+================+| Fri Mar 06 03:40:28 UTC 2026 | 1772768428 | modify | admin | 192.168.18.238 |+------------------------------+-------------+-------------+--------+----------------+sonic# show system cfgdb-event+------------------------------+-------------+-------------+--------+----------------+| Time | Timestamp | Operation | User | IP |+==============================+=============+=============+========+================+| Fri Mar 06 03:51:04 UTC 2026 | 1772769064 | delete | admin | 192.168.18.238 |+------------------------------+-------------+-------------+--------+----------------+show system fs-status
Section titled “show system fs-status”[Command] show system fs-status
[Purpose] Used to view the system disk read/write status, with rw/ro states available.
[View] System View
[Use Cases]
sonic# show system fs-status+----------+------------------------------+--------------------+| Status | Detect-time | Detect-timestamp |+==========+==============================+====================+| rw | Thu Mar 05 07:02:14 UTC 2026 | 1772694134 |+----------+------------------------------+--------------------+sonic# show system fs-status+----------+------------------------------+--------------------+| Status | Detect-time | Detect-timestamp |+==========+==============================+====================+| ro | Thu Mar 05 06:59:14 UTC 2026 | 1772693954 |+----------+------------------------------+--------------------+show system users
Section titled “show system users”[Command] show system users
[Purpose] View users currently logged into the switch
[View] System View
[Use Cases]
sonic# show system usersadmin pts/0 2026-03-10 07:39 (192.168.18.238)admin pts/1 2026-03-10 07:26 (192.168.18.238)[Command] ping* target_address* [source* source_address***|vrf*** vrf_name***]] [size*** size***] [interval*** interval***] [repeat*** count***]**
[Purpose] Used to execute the ping diagnostic command.
[View] Linux View
[Parameter]
| Parameter | Description |
|---|---|
| target_address | Specifies the destination address for the ping |
| source_address | Specifies the source address for the ping request |
| source_interface | Specifies the source interface for the ping request |
| vrf_name | Specifies the VRF for the ping request |
| size | Specifies the packet length of the ping request |
| interval | Specifies the interval between ping requests |
| count | Specifies the number of ping request packets |
[Use Cases]
sonic# ping 1.1.1.1 interval 0.5traceroute
Section titled “traceroute”[Command]
ping <target_address> [source [ip <ip_address> |
[Purpose]
Used to execute the traceroute diagnostic command.
[View]
Linux View
[Parameter]
| Parameter | Description |
|---|---|
| target_address | Specifies the destination address for the ping |
| ip_address | Specifies the source address for the tracerouterequest |
| interface | Specifies the source interface for the tracerouterequest |
| vrf_name | Specifies the VRF for the ping request |
[Use Cases]
sonic# traceroute 192.168.0.78traceroute to 192.168.0.78 (192.168.0.78), 30 hops max, 60 byte packets1 192.168.0.1 2.347 ms 2.373 ms 2.486 ms2 172.16.1.1 1.954 ms 1.916 ms 2.057 ms3 172.16.1.11 3.159 ms 3.446 ms 3.587 ms4 192.168.0.78 1.739 ms 1.705 ms 1.669 msconfig-db.json
Section titled “config-db.json”[Purpose]
System configuration file.
[View]
Linux View
[Comment]
System configuration file directory: /etc/sonic/config-db.json stores the currently saved configuration of the system. The system loads this configuration file during startup to restore the configuration. It is not recommended to directly modify the content of this file.
syslog
Section titled “syslog”[Purpose]
System log file.
[View]
Linux View
[Comment]
System log file directory: /var/log/syslog stores the runtime logs of the current system. You can open this file to view system operation logs. System logs are periodically compressed. To view older logs, you can check the compressed files at /var/log/syslog.
tcpdump
Section titled “tcpdump”[Command]
tcpdump -i* interface_name***[-Qin] [-Qout] [-w xxx.pcap]**
[Purpose]
Capture packets on a specified interface.
[View]
Linux View
[Parameter]
| Parameter | Description |
|---|---|
| *interface_name * | Specifies the interface for packet capture. Supported interfaces include physical interfaces, LAG interfaces, and VLAN interfaces |
| Qin/Qout | Specifies Specifies the packet capture direction as inbound or outbound; by default, both directions are captured. |
| -w | Specifies that captured packets should be saved locally. |
[Use Cases]
admin@sonic:~$ tcpdump -i Vlan100 -w Vlan100.pcap[Command]
ftp* x.x.x.x*
[Purpose]
Transfer files using the FTP method
[View]
Linux View
[Parameter]
| Parameter | Description |
|---|---|
| x.x.x.x | The Ftp server address |
[Use Cases]
admin@sonic:~$ ftpftp> admin@sonic:~$ ftp 192.168.0.78Connected to 192.168.0.78.220 (vsFTPd 3.0.3)Name (192.168.0.78:admin): teraspek331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp> put 14.pcaplocal: 14.pcap remote: 14.pcap200 PORT command successful. Consider using PASV.150 Ok to send data.226 Transfer complete.29424 bytes sent in 0.00 secs (64.6565 MB/s)ftp>[Command]
tftp* x.x.x.x*
[Purpose]
Transfer files using the Ttfp method
[View]
Linux View
[Parameter]
| Parameter | Description |
|---|---|
| x.x.x.x | The tftp server address |
[Use Cases]
admin@sonic:~$ tftp 192.168.0.7tftp> put 14.pcapSent 29461 bytes in 0.0 secondstftp>screen-paging disable
Section titled “screen-paging disable”[Command]
screen-paging disable no screen-paging disable
[Purpose]
Disable pagination for screen display
[View]
System Configuration View
[Comment]
Users can change the terminal screen display pagination settings for easier Viewing of configurations when executing commands multiple times with extensive output lines on the device.
[Use Cases]
sonic# screen-paging disable[Command] watch [interval* interval***] [diff] [err-quit]*** commands*
[Purpose] Periodically Execute Display Commands
[Parameter]
| Parameter | Description |
|---|---|
| interval | Interval for executing the command. Default: 5 seconds. Range: 1 – 254 seconds |
| diff | Highlights differences when the current command output differs from the previous one |
| err-quit | Automatically exits when an error occurs during command execution |
| commands | The specific command to execute. Only a single show command is supported |
[View] System View
[Comment] When users need to repeatedly execute the same command on the device, this command can be used for automatic execution. The command output is displayed on the screen in real time at regular intervals for easy observation. Press the q or Q key to exit.
[Use Cases]
sonic# watch interval 2 diff err-quit show counters interface