Skip to content

Commit

Permalink
ssd_mitigation_changes (#829)
Browse files Browse the repository at this point in the history
* ssd_mitigation_changes

* ssd_mitigation_changes

* ssd_mitigation_changes
  • Loading branch information
rkdevi27 authored Apr 30, 2020
1 parent 3471926 commit e747456
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ASSISTANT_SCRIPT="/usr/bin/neighbor_advertiser"
DEVPATH="/usr/share/sonic/device"
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
PLATFORM_PLUGIN="${REBOOT_TYPE}_plugin"
LOG_SSD_HEALTH="/usr/bin/log_ssd_health"

# Require 100M available on the hard drive for warm reboot temp files,
# Size is in 1K blocks:
Expand Down Expand Up @@ -424,6 +425,12 @@ fi
# service will go down and we cannot recover from it.
set +e
if [ -x ${LOG_SSD_HEALTH} ]; then
debug "Collecting logs to check ssd health before fast-reboot..."
${LOG_SSD_HEALTH}
fi
# Kill nat docker after saving the conntrack table
debug "Stopping nat ..."
/usr/bin/dump_nat_entries.py
Expand Down
7 changes: 7 additions & 0 deletions scripts/log_ssd_health
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

smartctl -a /dev/sda > /tmp/smartctl
if [ -f /tmp/smartctl ];then
logger -f /tmp/smartctl
fi

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'scripts/intfutil',
'scripts/intfstat',
'scripts/lldpshow',
'scripts/log_ssd_health',
'scripts/mmuconfig',
'scripts/natclear',
'scripts/natconfig',
Expand Down

0 comments on commit e747456

Please sign in to comment.