About Hard disk health
Hi,
Can we collect the information on hard disk having health issue (Bad Sectors)?
eg: ID C5 Current pending sector count
ID C6 Correctable sector count
Thanks.
0
Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.
Hi,
Can we collect the information on hard disk having health issue (Bad Sectors)?
eg: ID C5 Current pending sector count
ID C6 Correctable sector count
Thanks.
Comments
If you know how to do that via command line, you can run remote commands in PDQ Inventory, and the results will come back in the remote command window.
As an example, you can open a computer, use the "Remote Command" option from the Tools tab, and run chkdsk C: and once it's complete you'll see everything you expect to see from chkdsk.
Hi Pushpak,
if you need extended health information of your hard drives, you can reach for SmartCTL. Its a free tool from SmartTools. I have a script which I deploy via PDQ Deploy and it sends me a email with a extended report attached. If you wish I can share.
Yes Please, It will be really helpful.
Thanks Selfman.
Ok, the package contains:
#run.cmd
blat.dll
blat.exe < command line mail http://www.blat.net/
blat.lib
blatdll.h
doff.exe < Windows Date Display
drivedb.h
help.txt
mail-body-FAILED.txt
mail-body-PASSED.txt
smartctl.exe < command line SMART tools https://www.smartmontools.org
update-smart-drivedb.exe < drivedb.h updater utility
MAIL BODY FAILED:
-------------------------------------
HDD S.M.A.R.T. report
HDD/SSD TEST RESULT: FAILED
Check the logs for more information!
<some signature>
-------------------------------------
MAILBODY PASSED
-------------------------------------
HDD S.M.A.R.T. report
HDD/SSD TEST RESULT: PASSED
Check the logs for more information!
<some signature>
-------------------------------------
#run.cmd
-------------------------------------
@echo off
setlocal EnableDelayedExpansion
rem SMART Reporting batch
for /f %%i IN ('doff.exe yyyymmdd') DO SET ThisDate=%%i
set ReportDIR=C:\Windows\SMART-Reports
set ReportLog="%COMPUTERNAME%-SMART-TEST.log"
IF NOT EXIST %ReportDIR% mkdir %ReportDIR%
smartctl.exe -x C: >%ReportLog%
if exist %ReportLog% (
@findstr /i /C:"SMART overall-health self-assessment test result: PASSED" %ReportLog% > NUL
if !Errorlevel! EQU 0 (
set testResult=PASSED
) else (
set testResult=FAILED
)
blat -bodyF "mail-body-!testResult!.txt" -f <from mail> -to <to mail> -subject "SMART Report - %COMPUTERNAME% [%ThisDate%] - !testResult!" -server <your smtp server> :25 -noh -attach %ReportLog% -base64 -q -timestamp -log "%ReportDIR%\smart-mail.log"
move %ReportLog% %ReportDIR%\%ThisDate%-%ReportLog%
) ELSE (
echo %ThisDate% File attachment not found... >> %ReportDIR%\smart-scan.log
)
-------------------------------------
- change the date format in Doff according your preferences.
- specify from and to mail addresses
- enter your SMTP host address (the one which handles your mailbox as its a direct delivery)
- pack all the files using winrar in a self-extracting archive like smart-report.exe and specify #run.cmd to be executed after extraction
;The comment below contains SFX script commands
Setup=#run.cmd
TempMode
Silent=1
Overwrite=1
Oh, I forgot the URL for Doff.exe
http://wiki.inisec.com/index.php/Windows_Date_Display
The logs are allways stored in C:\Windows\SMART-Reports folder for later review, you might add some cleaning routine to the script as well.
And as allways - use at your own risc ;-)
blat.dll, blat.lib, blatdll.h and help.txt are not essential to run the script, they were just part of the packages. They are not needed.
Oh and a Hint - when you load two of the reports in to WinMerge, you canvery nicely see what has changed, as the report is pretty extensive.
Fantastic :)
one more favor please, can we rename the file as per result?
For example: "02052017-Demo-PC-SMART-TEST.log" is the default name generated by your script
Rename it to as per result,
If failed : "02052017-Demo-PC-SMART-TEST-Failed.log"
If passed : "02052017-Demo-PC-SMART-Passed.log"
Thanks.
You can change it the way you wish... There is no harm in it.
But because of sorting of the files I recommend to stay wit the YYYYMMDD format.