diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2012-12-11 17:09:51 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2012-12-11 17:09:51 +0000 |
commit | 398e9b005993bb30ac4a9b9c6f1763f7155bebd2 (patch) | |
tree | ee53843aa82030db9fe68ab7e8f45e430bee3e2c /etc/daily | |
parent | fab3b39aeba467b67b2ebe0bbbba0b4560502a1c (diff) |
Add a SMART check using atactl(8) against disks that support and have
SMART enabled.
Committing now so that it gets broader testing.
Man page bits will be added once we are confident there is no side
effect and this can stay.
inputs from sthen@ halex@ weerd@
ok deraadt@
Diffstat (limited to 'etc/daily')
-rw-r--r-- | etc/daily | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/daily b/etc/daily index 02f443f0e8d..e7c00b2550c 100644 --- a/etc/daily +++ b/etc/daily @@ -1,5 +1,5 @@ # -# $OpenBSD: daily,v 1.74 2012/02/11 00:37:04 krw Exp $ +# $OpenBSD: daily,v 1.75 2012/12/11 17:09:50 ajacoutot Exp $ # From: @(#)daily 8.2 (Berkeley) 1/25/94 # # For local additions, create the file /etc/daily.local. @@ -143,6 +143,15 @@ while [ "X$ROOTBACKUP" = X1 ]; do done next_part "Checking subsystem status:" +for d in $(sysctl -n hw.disknames | grep -Eo '[sw]d[0-9]+'); do + if atactl ${d} 2>&1 | sed -n '/Device has enabled/,$p' | grep -q 'SMART feature set'; then + SMARTSTATUS=$(atactl ${d} smartstatus 2>&1 >/dev/null) + if [ "X${SMARTSTATUS}" != X"" ]; then + echo "" + echo "${d}: ${SMARTSTATUS}" + fi + fi +done if [ "X$VERBOSESTATUS" != X0 ]; then echo "" echo "disks:" |