[stordis-toc]
Introduction
Regular monitoring of network switches is essential to ensure stable and efficient operation. If your switch runs on SONiC NOS, there are several ways to check its health status. In this article, we’ll go through key methods and commands that help verify system performance, detect issues, and keep your network running smoothly.
Â
Prerequisites
- Access to the switch: Administrator credentials for logging into the switch via SSH or console.
- Terminal software: Such as PuTTY, SecureCRT, or a Linux/macOS terminal for connecting to the switch.
- Network connection: A stable connection to the switch (direct console access or SSH).
- Storage for logs: A location to save tech-support logs (local PC or remote server).
Â
What you need
- Tech-Support dump
- Output of smartctl command
Â
STEP1: Generate Tech-Support dump
- Login to switch
sonic login: admin Password: Linux sonic 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 You are on ____ ___ _ _ _ ____ / ___| / _ \| \ | (_)/ ___| \___ \| | | | \| | | | ___) | |_| | |\ | | |___ |____/ \___/|_| \_|_|\____| -- Software for Open Networking in the Cloud -- Unauthorized access and/or use are prohibited. All access and/or use are subject to monitoring. Help: https://sonic-net.github.io/SONiC/ Last login: Fri Mar 28 11:25:47 UTC 2025 on ttyS0 admin@sonic:~$
- Generate Tech-Support
admin@sonic:~$ show techsupport . . . [ Final Cleaning and Compressing ] : 734 msec cleanup_tmpfiles /var/dump/sonic_dump_sonic_20250328_115141.tar.gz removed '/tmp/techsupport_time_info.PleDUTlek9' removed '/tmp/techsupport_index_info.02SmHxusjK' removed '/tmp/techsupport_save_proc_info' removed '/tmp/reference' update_db_state Completed $TARFILE
Note
This command may take a while to complete and may cause slowness in response. Tar File is generated at /var/dump/ and file name begins with 'sonic_dump_sonic_xxx'Â
- Download Tar File to your PC e.g. by scp
scp admin@x.x.x.x(switch ip):/var/dump/sonic_dump_sonic_xxx /local/path/
Â
STEP 2: Use smartctl utility to check disk health.
- use sudo smartctl -a /dev/sda command:
admin@sonic:~$ sudo smartctl -a /dev/sda smartctl 6.6 2017-11-05 r4594 [x86_64-linux-5.10.0-8-2-amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, http://www.smartmontools.org === START OF INFORMATION SECTION === Model Family: SiliconMotion based SSDs Device Model: TS32GMSA370 Serial Number: F855140247 LU WWN Device Id: 5 7c3548 198992397 Firmware Version: P1225CH1 User Capacity: 32,017,047,552 bytes [32.0 GB] Sector Size: 512 bytes logical/physical Rotation Rate: Solid State Device Device is: In smartctl database [for details use: -P show] ATA Version is: ACS-2 (minor revision not indicated) SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Sun Jun 18 14:59:24 2023 UTC SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x00) Offline data collection activity was never started. Auto Offline Data Collection: Disabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 0) seconds. Offline data collection capabilities: (0x71) SMART execute Offline immediate. No Auto Offline data collection support. Suspend Offline collection upon new command. No Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0002) Does not save SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 1) minutes. Conveyance self-test routine recommended polling time: ( 1) minutes. SMART Attributes Data Structure revision number: 1 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0000 100 100 000 Old_age Offline - 0 5 Reallocated_Sector_Ct 0x0000 100 100 000 Old_age Offline - 0 9 Power_On_Hours 0x0000 100 100 000 Old_age Offline - 1 12 Power_Cycle_Count 0x0000 100 100 000 Old_age Offline - 21 160 Uncorrectable_Error_Cnt 0x0000 100 100 000 Old_age Offline - 0 161 Valid_Spare_Block_Cnt 0x0000 100 100 000 Old_age Offline - 159 163 Initial_Bad_Block_Count 0x0000 100 100 000 Old_age Offline - 5 164 Total_Erase_Count 0x0000 100 100 000 Old_age Offline - 4679 165 Max_Erase_Count 0x0000 100 100 000 Old_age Offline - 6 166 Min_Erase_Count 0x0000 100 100 000 Old_age Offline - 0 167 Average_Erase_Count 0x0000 100 100 000 Old_age Offline - 2 168 Max_Erase_Count_of_Spec 0x0000 100 100 000 Old_age Offline - 3000 169 Remaining_Lifetime_Perc 0x0000 100 100 000 Old_age Offline - 100 175 Program_Fail_Count_Chip 0x0000 100 100 000 Old_age Offline - 0 176 Erase_Fail_Count_Chip 0x0000 100 100 000 Old_age Offline - 0 177 Wear_Leveling_Count 0x0000 100 100 050 Old_age Offline - 0 178 Runtime_Invalid_Blk_Cnt 0x0000 100 100 000 Old_age Offline - 0 181 Program_Fail_Cnt_Total 0x0000 100 100 000 Old_age Offline - 0 182 Erase_Fail_Count_Total 0x0000 100 100 000 Old_age Offline - 0 192 Power-Off_Retract_Count 0x0000 100 100 000 Old_age Offline - 9 194 Temperature_Celsius 0x0000 100 100 000 Old_age Offline - 28 195 Hardware_ECC_Recovered 0x0000 100 100 000 Old_age Offline - 0 196 Reallocated_Event_Count 0x0000 100 100 016 Old_age Offline - 0 197 Current_Pending_Sector 0x0000 100 100 000 Old_age Offline - 0 198 Offline_Uncorrectable 0x0000 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0000 100 100 050 Old_age Offline - 0 232 Available_Reservd_Space 0x0000 100 100 000 Old_age Offline - 100 241 Host_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 177 242 Host_Reads_32MiB 0x0000 100 100 000 Old_age Offline - 148 245 TLC_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 2339 SMART Error Log Version: 1 No Errors Logged SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t] SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing 6 0 65535 Read_scanning was never started Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.
- Save output of these commands.
Â
How to Use These Files?
Once you have collected the necessary files, you have two options for analysis:
- Self-Analysis – You can review the files yourself by checking system logs, error messages, or performance metrics to identify potential issues. If you have internal tools or expertise, this may help you quickly diagnose the problem.
- Send Them for Expert Analysis – If you need further assistance, we’re happy to help! You can send the files to us for a detailed review. Our team will analyze the data and provide insights or recommendations. Please follow the instructions in the ticket/email to securely submit the files.
Â
Useful links
How to set up your first console connection to the open networking switch?
Â
For more free resources, visit:Â https://stordis.com/free-resources/
Â
Â