Skip to content

Commit e747456

Browse files
authored
ssd_mitigation_changes (sonic-net#829)
* ssd_mitigation_changes * ssd_mitigation_changes * ssd_mitigation_changes
1 parent 3471926 commit e747456

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

scripts/fast-reboot

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ASSISTANT_SCRIPT="/usr/bin/neighbor_advertiser"
1616
DEVPATH="/usr/share/sonic/device"
1717
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
1818
PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin"
19+
LOG_SSD_HEALTH="/usr/bin/log_ssd_health"
1920

2021
# Require 100M available on the hard drive for warm reboot temp files,
2122
# Size is in 1K blocks:
@@ -424,6 +425,12 @@ fi
424425
# service will go down and we cannot recover from it.
425426
set +e
426427
428+
if [ -x ${LOG_SSD_HEALTH} ]; then
429+
debug "Collecting logs to check ssd health before fast-reboot..."
430+
${LOG_SSD_HEALTH}
431+
fi
432+
433+
427434
# Kill nat docker after saving the conntrack table
428435
debug "Stopping nat ..."
429436
/usr/bin/dump_nat_entries.py

scripts/log_ssd_health

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/bash
2+
3+
smartctl -a /dev/sda > /tmp/smartctl
4+
if [ -f /tmp/smartctl ];then
5+
logger -f /tmp/smartctl
6+
fi
7+

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
'scripts/intfutil',
8080
'scripts/intfstat',
8181
'scripts/lldpshow',
82+
'scripts/log_ssd_health',
8283
'scripts/mmuconfig',
8384
'scripts/natclear',
8485
'scripts/natconfig',

0 commit comments

Comments
 (0)