Command Line Reference
Device Management
Diagnostic-information Configuration
12 min
show diagnostic information \[since|count] 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 2 ping ping \[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 5 traceroute traceroute \[command] ping \<target address> \[source \[ip \<ip address> |\<interface>] \[vrf \<vrf name>] \[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 78 traceroute to 192 168 0 78 (192 168 0 78), 30 hops max, 60 byte packets 1 192 168 0 1 2 347 ms 2 373 ms 2 486 ms 2 172 16 1 1 1 954 ms 1 916 ms 2 057 ms 3 172 16 1 11 3 159 ms 3 446 ms 3 587 ms 4 192 168 0 78 1 739 ms 1 705 ms 1 669 ms config db json 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 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 \<id> gz the system can store a maximum of 1,000 compressed syslog files the /var/log directory also stores runtime logs for other modules, such as auth log, ptp log, ztp log, etc the method for viewing these logs is the same as for syslog it is not recommended to directly edit the contents in this directory tcpdump 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 ftp ftp \[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 $ ftp ftp> admin\@sonic $ ftp 192 168 0 78 connected to 192 168 0 78 220 (vsftpd 3 0 3) name (192 168 0 78\ admin) teraspek 331 please specify the password password 230 login successful remote system type is unix using binary mode to transfer files ftp> put 14 pcap local 14 pcap remote 14 pcap 200 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> tftp tftp \[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 7 tftp> put 14 pcap sent 29461 bytes in 0 0 seconds tftp> screen paging disable 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
