Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to check SMART status on startup/login' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to check SMART status on startup/login
Authored by: chabig on Aug 06, '04 01:09:30PM
I've been using this one for over a year. I use Macaroni to run a simple shell script that calls this applescript every day... Here is the Applescript:

set status to do shell script "diskutil info disk0 | grep SMART"
if status is not " SMART Status: Verified" then
do shell script "echo -n 'Disk last checked on ';date;echo SMART status: Problem Detected!"
tell application "Finder"
display dialog "A hardware problem has been detected on your hard drive:" & return & return & status
end tell
else
do shell script "echo -n 'Disk last checked on ';date;echo SMART status: Verified."
end if


And here is the shell script:

#!/bin/sh
# This script runs an Applescript to check the S.M.A.R.T. status of the hard drive
# and if the status is anything other than "verified" it puts up an alert.

osascript "/Users//Documents/Scripts/CheckDiskStatus.app"

exit


[ Reply to This | # ]
An AppleScript to check SMART status on startup/login
Authored by: baltwo on Aug 06, '04 06:58:32PM

It appears that this only works for a single disk—disk0. You'd have to expand it to cover additional internal disks, including removable ones.



[ Reply to This | # ]