S.M.A.R.T Drive Status???
Am I missing something or does PDQ inventory no collect the S.M.A.R.T status of drives on computers?
-
Here I am, 5 years later with how I set it up
New Dynamic Collection: SMART Status OK
Filter: Disk Drive
Column: SMART Status
Comparison: Equals
Value: OK
New Dynamic Collection: SMART Status Not OK
Filter: Disk Drive
Column: SMART Status
Comparison: Does Not Equal
Value: OK
Although, that script above IS pretty bada$$
-
This is what I've come up with as a workaround...
The script below is deployed out to all of my computers using a simple Command step in a package. What this does is create a text file located at C:\SmartStatus\ with the filename status.txt. This file contains the actual status of the dirve. PDQ inventory has no way of reading the files contents when performing an inventory scan so what the script does is rename the file to OK.txt if the status is OK, and ERROR.txt if there is a problem.I can then setup a file scan in PDQ inventory to check for these files and setup collections or reports for any computers that may still be working but S.M.A.R.T has detected a problem on the drive.
@echo off md c:\SmartStatus del c:\SmartStatus\status.txt /Q wmic /OUTPUT:c:\SmartStatus\status.txt diskdrive get status find "OK" C:\SmartStatus\status.txt >nul if %errorlevel%==0 GoTo doingGood ren C:\SmartStatus\status.txt ERROR.txt GoTo done :doingGood ren C:\SmartStatus\status.txt OK.txt :done
-
@echo off
md c:\SmartStatus
del c:\SmartStatus\status.txt /Q
wmic /OUTPUT:c:\SmartStatus\status.txt diskdrive get status
find "OK" C:\SmartStatus\status.txt >nul
if %errorlevel%==0 GoTo doingGood
ren C:\SmartStatus\status.txt ERROR.txt
GoTo done
:doingGood
ren C:\SmartStatus\status.txt OK.txt
:done
-
that looks good, should show all computers with OK.txt (meaning no issues).
Double click on one of your computers in PDQ inventory and look at its list of files to see if it has OK.txt or Error.txt if it does not then either the package has not run on the machine yet or the custom file scan is not picking up the file.
-
Hey Mmuni, I know this is old but I like what you've done with the script, just one thing however. At the beginning it deletes status.txt but that file wont exist anymore anyway if its already run through once it will either be called OK or Error. So next time you run it it fails because it cannot change the name of status.txt to an existing file name.
Forgive me if Ive misunderstood anything, I modified the code as follows:
@echo off
md c:\SmartStatus
del c:\SmartStatus\OK.txt /Q
del c:\SmartStatus\ERROR.txt /Q
wmic /OUTPUT:c:\SmartStatus\status.txt diskdrive get status
find "OK" C:\SmartStatus\status.txt >nul
if %errorlevel%==0 GoTo doingGood
ren C:\SmartStatus\status.txt ERROR.txt
GoTo done
:doingGood
ren C:\SmartStatus\status.txt OK.txt
:doneThanks.
Please sign in to leave a comment.
Comments
17 comments