batch script - alert with sound for smart hdd probelms fix
smartmontools detect failure at boot
This is a small batch script that starts an alert if a "FAILED" string is found in the smartctl report.
@Echo on
SET SMARTBIN=smartmontools\smartctl.exe
SET REPORTFILE=smartinfo.txt
%SMARTBIN% --scan > smartdrives.txt
for /F "tokens=1" %%i in (smartdrives.txt) do %SMARTBIN% -s on %%i > %REPORTFILE% && %SMARTBIN% -i %%i >> %REPORTFILE% && %SMARTBIN% -H %%i >> %REPORTFILE%
findstr /m "FAILED" %REPORTFILE%
if %errorlevel%==0 (
sound\cmdmp3win.exe sound\alert.mp3
)
I personally cannot suggest smatmontools "as is" without the parsing of the S.M.A.R.T. data or full test with smartmontools.
After creting this sample script I have faced the reality that my HD smart report was not correct .
I prefer to manually check with crystaldisk because it reports as "good" or "problematic" without wasting time and with more accuracy (I hope).
smartmontools detect failure at boot
This is a small batch script that starts an alert if a "FAILED" string is found in the smartctl report.
@Echo on
SET SMARTBIN=smartmontools\smartctl.exe
SET REPORTFILE=smartinfo.txt
%SMARTBIN% --scan > smartdrives.txt
for /F "tokens=1" %%i in (smartdrives.txt) do %SMARTBIN% -s on %%i > %REPORTFILE% && %SMARTBIN% -i %%i >> %REPORTFILE% && %SMARTBIN% -H %%i >> %REPORTFILE%
findstr /m "FAILED" %REPORTFILE%
if %errorlevel%==0 (
sound\cmdmp3win.exe sound\alert.mp3
)
I personally cannot suggest smatmontools "as is" without the parsing of the S.M.A.R.T. data or full test with smartmontools.
After creting this sample script I have faced the reality that my HD smart report was not correct .
I prefer to manually check with crystaldisk because it reports as "good" or "problematic" without wasting time and with more accuracy (I hope).
Comments
Post a Comment