Skip to main content

batch script - alert with sound for smart hdd probelms fix

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).

Comments

Popular posts from this blog

Moodle 3.8.1+ - path leak via errors in several files

Moodle 3.8.1+ ----------------------------------------------- File: admin/mailout-debugger.php #!/usr/bin/php Notice : Disabled. in \admin\mailout-debugger.php on line 73 File: admin/settings/appearance.php Notice : Undefined variable: hassiteconfig in \admin\settings\appearance.php on line 10 Fatal error : Uncaught Error: Call to undefined function has_any_capability() in \admin\settings\appearance.php:10 Stack trace: #0 {main} thrown in \admin\settings\appearance.php on line 10 File: admin/settings/badges.php Notice : Undefined variable: hassiteconfig in \admin\settings\badges.php on line 30 Fatal error : Uncaught Error: Call to undefined function has_any_capability() in \admin\settings\badges.php:30 Stack trace: #0 {main} thrown in \admin\settings\badges.php on line 30 File: admin/settings/courses.php Notice : Undefined variable: hassiteconfig in \admin\settings\courses.php on line 32 Fatal error : Uncaught Error: Call to undefined function

2022 - Remove (the too many) Ads from Memu launcher

Simple method Download from pureapk "MEmu Launcher2" ex: MEmu Launcher2_v6.0.9_apkpure.com Install "System app remover" (root) remove from system apps the "memu launcher 2" import the "purified" MEmu Launcher2 apk with the Memu utility ("apk" on the right toolbar) Longer method Install "Export Apk" Export the memu launcher2  Install purify https://github.com/echo-devim/purify/raw/master/Purify.apk use purify with the exported memu launcher 2 Install "System app remover" (root) remove from system apps the "memu launcher 2" import the "purified" MEmu Launcher2 apk with the Memu utility ("apk" on the right toolbar)