Device Management
Device Status
Section titled “Device Status”show version
Section titled “show version”[Command]
show version
[Purpose]
Show system version
[View]
System view
[Notes]
This command displays version information including: software, description, kernel, create, and image.
[Use Cases]
admin@sonic:~$ show versionSONiC Software Version: SONiC.AsterNOS-V5.2R001T001-dirty-20220807.083641Distribution: Debian 9.13Kernel: 5.10.34-asternosBuild commit: f1376ee06Build date: Sun Aug 7 12:45:57 UTC 2022Built by: aster@arm64-compile-serverPlatform: arm64-asterfusion_gesp1u_4y48x_1_s-r0HwSKU: X204Y-48S-MASIC: marvellSerial Number: F020015A003Uptime: 06:47:53 up 41 min, 7 users, load average: 0.24, 0.37, 0.35Docker images:...
show platform fan
Section titled “show platform fan”[Command]
show platform fan
[Purpose]
View fan information
[View]
System view
[Use Cases]
sonic# show platform fan FAN Speed Direction Presence Status Timestamp----- ------- ----------- ---------- -------- ------------------- FAN1 8625RPM exhaust Present OK 2022-08-18 08:59:45 FAN2 8715RPM exhaust Present OK 2022-08-18 08:59:45 FAN3 8580RPM exhaust Present OK 2022-08-18 08:59:45 FAN4 8715RPM exhaust Present OK 2022-08-18 08:59:45Description of the **show platform fan** command output
Item | Description |
---|---|
Speed | Fan speed |
Direction | Fan wind direction exhaust:Blowing wind outward inhaust:Inward air suction |
Presence | Is the fan in place |
Status | Fan Status |
Timestamp | Get the time of the current state |
show platform psu-status
Section titled “show platform psu-status”[Command]
show platform psu-status
[Purpose]
View power status
[View]
System view
[Notes]
Item | Description |
---|---|
OK | In place and properly powered |
NOT OK | In place but no power supply |
NOT PRESENT | Not in position |
[Use Cases]
sonic# show platform psu-statusPSU Status----- -----------PSU 1 OKPSU 2 NOT OK
show platform summary
Section titled “show platform summary”[Command]
show platform summary
[Purpose]
View hardware platform information
[View]
System view
[Use Cases]
sonic# show platform summaryPlatform: arm64-asterfusion_x206y_48t_ma-r0HwSKU: CX206Y-48GT-HPW4-MASIC: marvell
show platform temperature
Section titled “show platform temperature”[Command]
show platform temperature
[Purpose]
View hardware platform information
[View]
System view
[Use Cases]
sonic# show platform temperature
show image
Section titled “show image”[Command]
show image
[Purpose]
Display the system’s installed firmware
[View]
System view
[Use Cases]
sonic# show imageCurrent: SONiC-OS-HEAD.0-51e434286Next: SONiC-OS-HEAD.0-51e434286Available:SONiC-OS-HEAD.0-51e434286SONiC-OS-HEAD.0-7ecdef796
show feature state
Section titled “show feature state”[Command]
show feature state
[Purpose]
Check if the feature is enabled
[View]
System view
[Notes]
The processes related to all features on the current system are running in the corresponding containers, and the corresponding containers will be started after the feature is enabled. The containers in the always_enabled state are not allowed to be closed.
[Use Cases]
sonic# show feature stateFeature State--------------- --------------lldp enabledpmon always_enabledsnooping always_enableddhcp_relay always_enableddatabase always_enabledsnmp disableddot1x disabledbgp always_enabledradv always_enabledproxy always_enabledmstpd disabledweb-server disabledteamd always_enabledsyncd always_enableducentral-client disabledswss always_enabledslad always_enabled
show ztp
Section titled “show ztp”[Command]
show ztp
[Purpose]
Display ZTP execution results
[View]
System view
[Use Cases]
sonic# show ztpZTP Admin Mode : TrueZTP Service : InactiveZTP Status : FAILEDZTP Source : dhcp-opt67 (Ethernet10)Runtime : 23m 16sTimestamp : 2024-06-20 09:03:04 UTCZTP Service is not runningconfigdb-json: SUCCESSupload-log: FAILED
show ztp verbose
Section titled “show ztp verbose”[Command]
show ztp verbose
[Purpose]
Display detailed ZTP execution results
[View]
System view
[Use Cases]
sonic# show ztp verboseCommand: ztp status --verbose========================================ZTP========================================ZTP Admin Mode : TrueZTP Service : InactiveZTP Status : FAILEDError : upload-log FAILEDZTP Source : dhcp-opt67 (Ethernet10)Runtime : 23m 16sTimestamp : 2024-06-20 09:03:04 UTCZTP JSON Version : 1.0ZTP Service is not running----------------------------------------configdb-json----------------------------------------Filename : ftp://teraspek:teraspek@150.1.0.1/POAM_CFG/aster666.jsonStatus : SUCCESSRuntime : 17sTimestamp : 2024-06-20 08:59:19 UTCExit Code : 0Ignore Result : False----------------------------------------upload-log----------------------------------------Status : FAILEDRuntime : 03m 45sTimestamp : 2024-06-20 09:03:04 UTCExit Code : 20Error : Plugin failedIgnore Result : False
show environment powers
Section titled “show environment powers”[Command]
show environment powers
[Purpose]
Display power supply details
[View]
System view
[Use Cases]
sonic# show environment powersPSU_STATUS: PSU1: model: G1251-055 Input Voltage: +233.00 V Output Voltage: +12.07 V Fan Speed: 4136 RPM Temperature: +35.3 C Input Power: 38.06 W Output Power: 30.44 W Input Current: +0.21 A Output Current: +2.52 A (max = +45.00 A) PSU2: model: G1251-055 Input Voltage: +0.00 V Output Voltage: +0.00 V Fan Speed: 0 RPM Temperature: +29.9 C Input Power: 0.00 W Output Power: 0.00 W Input Current: +0.00 A Output Current: +0.00 A (max = +45.00 A)
show system memory-usage
Section titled “show system memory-usage”[Command]
show system memory-usage
[Purpose]
Display the current memory usage of the device
[View]
System view
[Notes]
When the device’s memory usage exceeds 80%, executing this command will display the top 10 processes by memory usage
[Use Cases]
sonic# show system memory-usage+------------------+| Memory usage % ||------------------|| 53.1 |+------------------++---------------+---------------+---------------+-------------+--------------+---------------+| total | used | free | shared | buff/cache | available ||---------------+---------------+---------------+-------------+--------------+---------------|
| 4186353664(B) | 2125402112(B) | 1292824576(B) | 19099648(B) | 768126976(B) | 1962168320(B) || 3.90(GB) | 1.98(GB) | 1.20(GB) | 18.21(MB) | 732.54(MB) | 1.83(GB) |+---------------+---------------+---------------+-------------+--------------+---------------+
show system cpu-usage
Section titled “show system cpu-usage”[Command]
show system cpu-usage
[Purpose]
Display the current CPU usage of the device.
[View]
System view
[Notes]
When the device’s CPU usage exceeds 80%, executing this command will display the top 10 processes by CPU usage.
[Use Cases]
sonic# show system cpu-usage+---------------+| Cpu usage % ||---------------|| 18.3 |+---------------+
show system disk-usage
Section titled “show system disk-usage”[Command]
show system disk-usage
[Purpose]
Display the current disk utilization of the device.
[View]
System view
[Notes]
When the device’s disk utilization exceeds 80%, executing this command will display the major files occupying disk space.
[Use Cases]
sonic# show system disk-usage+----------------+| Disk usage % ||----------------|| 27.4 |+----------------++----------------+---------------+----------------+| total | used | free ||----------------+---------------+----------------|| 29357916160(B) | 8025161728(B) | 21315977216(B) || 27.34(GB) | 7.47(GB) | 19.85(GB) |
Device Configuration
Section titled “Device Configuration”hostname
Section titled “hostname”[Command]
hostname hostname
[Purpose]
Modify the device host name
[Parameter]
Parameter | Description |
---|---|
hostname | Host name |
[View]
System view
[Notes]
The hostname can be named with a maximum of 64 characters and can only contain ”.” , ”-”, “a-z”, “A-Z” and “0-9”.
It cannot start and end with ”.”, ”-”, and ”..” cannot appear. After modification, you need to save the configuration manually and log out to take effect again.
[Use Cases]
sonic# hostname sonic-226
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
[Notes]
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
NTP Configuration
Section titled “NTP Configuration”show ntp
Section titled “show ntp”[Command]
show ntp
[Purpose]
Show NTP information
[View]
System view
[Use Cases]
sonic# show ntp remote refid st t when poll reach delay offset jitter==============================================================================*10.250.0.240 203.107.6.88 3 u 46 64 377 0.165 10.575 3.198
ntp server
Section titled “ntp server”[Command]
ntp server ip-address [prefer]
no ntp server
[Purpose]
Configure NTP server
[Parameter]
Parameter | Description |
---|---|
ip-address | NTP server ip address |
[View]
System configuration view
[Use Cases]
sonic(config)# ntp server 10.250.0.242
ntp source-interface
Section titled “ntp source-interface”[Command]
ntp source-interface {ethernet interface_num |vlan vlan_id |loopback loopback_id |mgmt} [vrf {default|mgmt}]
no ntp source-interface
[Purpose]
Specify the NTP source interface
[View]
System configuration view
[Notes]
Configuring the local source interface for sending/receiving NTP packets can help avoid using IP addresses from other interfaces on this device as the destination address for response packets.
[Use Cases]
sonic(config)# ntp source-interface Loopback0 vrf default
System Time Configuration
Section titled “System Time Configuration”show clock
Section titled “show clock”[Command]
show clock
[Purpose]
Display time zone and time
[View]
System view
[Use Cases]
sonic# show clock
show supported-timezones
Section titled “show supported-timezones”[Command]
show supported-timezones
[Purpose]
Display the time zones supported by the system configuration
[View]
System view
[Use Cases]
sonic# show supported-timezones
clock datetime
Section titled “clock datetime”[Command]
clock datetime date_string time_string
[Purpose]
Configure system time
[Parameter]
Parameter | Description |
---|---|
date_string | Date value, YY-MM-DD format |
time_string | Time value, HH:MM:SS format |
[View]
System configuration view
[Usage Scenario]
When preparing to deploy a device, it’s essential to configure the system time of the device to the current actual time. This ensures that the device’s logs and alarm messages accurately reflect the timestamp of events. The device often comes with an arbitrary system time when it leaves the factory, which doesn’t represent the actual time.
[Use Cases]
sonic# configuresonic(config)# clock datetime 2022-02-22 20:30:30
clock timezone
Section titled “clock timezone”[Command]
clock timezone zone
no clock timezone
[Purpose]
Configure the system time zone, the default time zone is UTC
[Parameter]
Parameter | Description |
---|---|
zone | Timezone |
[View]
System view
[Use Cases]
sonic# configuresonic(config)# clock timezone Asia/Shang
POE Configuration
Section titled “POE Configuration”show interface poe
Section titled “show interface poe”[Command]
show interface poe
[Purpose]
Display interface POE information
[View]
System view
[Use Cases]
sonic# show interface poe
show interface poe diagnose
Section titled “show interface poe diagnose”[Command]
show interface poe diagnose
[Purpose]
Display interface POE initialization information
[View]
System view
[Usage Scenario]
This command displays information including POE hardware version, POE status, current POE temperature, alarm temperature, and the number of internal POE resets.
[Notes]
If the command results in a “device busy” message, it is normal. This indicates that the system is currently retrieving POE power information. Simply reissue the command to get the results.
[Use Cases]
sonic# show interface poe diagnosePSE device information:field value----------------- ------------------------------------version 0x4a02status OK Expected PoE device Found (Zone1)eventtemperature 48 Ctemperature-alarm 110 Creset-count 0initialized TruePSE wrong port map:Interface Current Id Expect Id----------- ------------ -----------
show interface poe pd alive-check status
Section titled “show interface poe pd alive-check status”[Command]
show interface poe pd alive-check status
[Purpose]
Display the PoE PD Alive Check configuration and status information for the interface.
[View]
System view
[Usage Scenario]
This command can display the configuration information for PoE PD Alive Check and its real-time status monitoring results.
[Notes]
When the interface’s PoE feature is disabled, both the last_ping_time
and alive
status will display as N/A.
[Use Cases]
sonic# show interface poe pd alive-check status----------------------------------------------------------------------config for delay/interval/err_threshold/action/reboot_interval+-------------+--------+------------------+-------------+---------------------+---------+----------+| Interface | mode | config | pd-ip | last_ping_time | alive | err_count |+=============+========+==================+=============+=====================+=========+===========+| Ethernet2 | enable | 60/15/3/alarm/30 | 192.168.0.1 | 2025-09-13 16:22:16 | True | 2 |+-------------+--------+------------------+-------------+---------------------+---------+----------+
poe enable
Section titled “poe enable”[Command]
poe enable
no poe enable
[Purpose]
Enable POE power supply function of the interface
[View]
Interface view
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe enable
poe delay
Section titled “poe delay”[Command]
poe-delay time
no poe-delay
[Purpose]
Configure the delayed start time of the interface POE function
[Parameter]
Parameter | Description |
---|---|
time | Range of values: 0-3600 |
[View]
Interface view
[Usage Scenario]
This command is used to delay the activation of Power over Ethernet (PoE) power supply on an interface based on actual usage requirements. When the uplink link state stabilizes, and the protocols are running correctly, PoE power is supplied to the connected PoE devices. This delay mechanism is useful for ensuring that PoE devices receive power only when the network is stable and ready to support them.
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe delay 300
poe max-power
Section titled “poe max-power”[Command]
poe max-power power
no poe max-power
[Purpose]
Configure the maximum output power of the device
[Parameter]
Parameter | Description |
---|---|
power | 60w/30w/15w/30w-at.The unit is: w |
[View]
System configuration view
[Notes]
By default, the maximum output power of a device is the power actually provided by the device. Therefore, the configured maximum output power must be lower than or equal to the total power of PoE power modules.
[Use Cases]
sonic(config)# poe max-power 60w
poe priority {low|high|critical}
Section titled “poe priority {low|high|critical}”[Command]
poe priority {low|high|critical}
[Purpose]
Configure the power priority of a PoE interface
[Parameter]
Parameter | Description |
---|---|
critical | Indicates the highest priority |
high | Indicates the second highest priority |
low | Indicates the lowest priority |
[View]
System configuration view
[Notes]
When the output power of a device is insufficient, the device in automatic power management mode provides power for the interfaces of the higher power supply priorities first and cuts off power of the interfaces of the lower power supply priorities. PoE switches provide power to PDs connected to the interfaces in the sequence in which PDs are connected to them.
By default, the power supply priority of an interface is low.
[Use Cases]
sonic(config)# interface ethernet 4sonic(config-if-4)# poe priority high
time-range time
Section titled “time-range time”[Command]
time-range name from date_stop to date_start
no time-range
[Purpose]
Configure PoE power-off time range
[Parameter]
Parameter | Description |
---|---|
name | Specifies the name of a time range |
date_stop | Specify the stop time of a time range, the format is hh:mm YY-MM-DD |
date_start | Specify the start time of a time range, the format is hh:mm YY-MM-DD |
[View]
System configuration view
[Use Cases]
sonic(config)# time-range test from 12:00 2022-01-01 to 16:00 2023-01-01
time-range date
Section titled “time-range date”[Command]
time-range name time_stop to time_start
no time-range
[Purpose]
Configure PoE power-off date range
[Parameter]
Parameter | Description |
---|---|
name | Specifies the name of a time range |
time_stop | Specify the stop time of a time range, the format is hh:mm |
time_start | Specify the start time of a time range, the format is hh:mm |
[View]
System configuration view
[Use Cases]
sonic(config)# time-range test 00:00 to 23:59 off-day
poe power-off time-range
Section titled “poe power-off time-range”[Command]
poe power-off time-range name
no poe power-off time-range
[Purpose]
Configure PoE power-off time range effective on an interface
[View]
Interface view
[Use Cases]
sonic(config)# interface ethernet 48sonic(config-if-48)# poe power-off time-range testWarning: This operation may power off some PD. Continue? **\[Y/N]**: y
poe legacy-detect enable
Section titled “poe legacy-detect enable”[Command]
poe legacy-detect enable
poe legacy-detect disable
[Purpose]
Enable device power supply compatibility detection for PD devices.
[View]
interface view
[Usage Scenario]
Enable compatibility detection for PD devices, allowing the device to detect PD devices that do not comply with the 802.3af or 802.3at standards and supply power to these PD devices. If the compatibility check for PD devices is not enabled, the device will not recognize non-standard PD devices and will be unable to supply power to them.
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe legacy-detect disable
poe reinitialize
Section titled “poe reinitialize”[Command]
poe reinitialize
[Purpose]
Initialize POE feature
[View]
System configuration view
[Usage Scenario]
If the device has not been initialized for POE at the factory, this command can be used for manual initialization. After executing this command, a device reboot is not required, but all POE functionalities will be automatically disabled. Once initialization is complete, POE will be enabled again
[Use Cases]
sonic(config)# poe reinitialize
poe pd alive-check enable
Section titled “poe pd alive-check enable”[Command]
poe pd alive-check enable
no poe pd alive-check enable
[Purpose]
Enable the PoE PD Alive Check detection function on the interface.
[View]
Interface view
[Usage Scenario]
It detects the status of the peer device by pinging the configured IP address. If the number of consecutive failed detection attempts exceeds the set threshold, it will generate a Warning alarm in the logs and execute the configured action.
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check enable
poe pd alive-check ip
Section titled “poe pd alive-check ip”[Command]
poe pd alive-check ip ip_address
no poe pd alive-check ip
[Purpose]
Configure the IP address for PoE PD Alive Check detection.
[View]
Interface view
[Parameter]
Parameter | Description |
---|---|
ip_address | support IPv4 address and IPv6 address |
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check ip 192.168.0.1
poe pd alive-check delay
Section titled “poe pd alive-check delay”[Command]
poe pd alive-check delay time
no poe pd alive-check delay
[Purpose]
Configure the delay time for PoE state restart after a PoE detection abnormality.
[View]
Interface view
[Parameter]
Parameter | Description |
---|---|
time | The detection delay after a PoE restart;Unit: seconds;Range: 5-600 |
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check delay 60
poe pd alive-check interval
Section titled “poe pd alive-check interval”[Command]
poe pd alive-check interval time
no poe pd alive-check interval
[Purpose]
Configure the detection interval for PoE PD Alive Check.
[View]
Interface view
[Parameter]
Parameter | Description |
---|---|
time | The detection interval for PoE PD Alive Check,;Unit: seconds; Range: 10-300 |
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check interval 30
poe pd alive-check err-threshold
Section titled “poe pd alive-check err-threshold”[Command]
poe pd alive-check err-threshold number
no poe pd alive-check err-threshold
[Purpose]
Configure the threshold for the number of PoE PD Alive Check detection errors.
[View]
Interface view
[Parameter]
Parameter | Description |
---|---|
number | The threshold for the number of PoE PD Alive Check detection errors; Unit: seconds; Range: 1-10. |
[Usage Scenario]
When the number of times the device detects that the IP is unreachable is greater than or equal to the configured error-count threshold, the configured action will be triggered and a Warning alarm log will be generated.
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check err-threshold 10
poe pd alive-check action {reboot|alarm}
Section titled “poe pd alive-check action {reboot|alarm}”[Command]
poe pd alive-check action {reboot|alarm}
no poe pd alive-check action
[Purpose]
Configure the action to be taken after a PoE PD Alive Check detection abnormality.
[View]
Interface view
[Parameter]
Parameter | Description |
---|---|
reboot | When an anomaly is triggered, only a Warning alarm log is generated. |
alarm | When an anomaly is triggered, both a Warning alarm log is generated and the interface’s PoE function is restarted.this action is default. |
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check action reboot
poe pd alive-check reboot-interval
Section titled “poe pd alive-check reboot-interval”[Command]
poe pd alive-check reboot-interval time
no poe pd alive-check reboot-interval
[Purpose]
Configure the interval between the PoE shutdown and the subsequent PoE restart on the interface after a PoE PD Alive Check anomaly is triggered.
[View]
Interface view
[Parameter]
Parameter | Description |
---|---|
time | The interval between the PoE shutdown and restart on the interface after a PoE PD Alive Check anomaly is triggered; Unit: seconds; Range: 1-180. |
[Use Cases]
sonic(config)# interface ethernet 1sonic(config-if-1)# poe pd alive-check reboot-interval 100
Log Threshold Configuration
Section titled “Log Threshold Configuration”show interface log-threshold
Section titled “show interface log-threshold”[Command]
show interface log-threshold
[Purpose]
Display interface bandwidth utilization alarms.
[View]
System view
[Notes]
If no specific alarm configuration is applied to a particular interface, this command will only display the default values and will not provide information for each individual interface.
[Use Cases]
sonic# show interface log-thresholdInterface Default Bandwidth utilization rx/tx alert_threshold: 80%, resume_threshold: 75%customer definedInterface rx_alert_threshold rx_resume_threshold tx_alert_threshold tx_resume_threshold----------- -------------------- --------------------- -------------------- ---------------------Ethernet2 70 60 70 60
log-threshold {tx|rx|both}
Section titled “log-threshold {tx|rx|both}”[Command]
log-threshold {tx|rx|both} alert_threshold resume_threshold
[Purpose]
Configure the bandwidth utilization log threshold value for the interface.
[View]
System view
[Parameter]
Parameter | Description |
---|---|
tx | Interface outgoing direction |
rx | Interface incoming direction |
both | Configure both RX and TX simultaneously |
alert_threshold | Alarm threshold, range 50-100, default value 80 |
resume_threshold | Recovery threshold, range 50-100, default value 75 |
[View]
interface view
[Usage Scenario]
Users can use this command to customize the alarm thresholds and recovery thresholds for the outgoing and incoming directions of a specific interface. When the alarm threshold is exceeded, Syslog begins to generate alarm logs; when it falls below the recovery threshold, the alarm is canceled.
[Use Cases]
sonic(config)# interface ethernet 2sonic(config-if-2)# log-threshold both 70 60
Diagnostic-information Configuration
Section titled “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 2