Comments

17 comments

  • Sara S

    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$$

    1
    Comment actions Permalink
  • Michael Muni

    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

    0
    Comment actions Permalink
  • Michael Muni

    @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

    0
    Comment actions Permalink
  • Michael Muni

    So far this has identified 6 computers with failing hard drives at one of my locations. The users had not reported any issues yet and I was able to get to them before they completely failed.

    0
    Comment actions Permalink
  • Shane Corellian

    Well done!

    I love seeing problem solving at work. We will look into adding this data natively in a future version.

    Props to you. Your organization is obviously well served.

    0
    Comment actions Permalink
  • Vincent

    Hi Shane,

    Any news for this new feature? That would be very useful for us.

    Thanks,

    Vincent

    0
    Comment actions Permalink
  • Shane Corellian

    We do have this feature tentatively scheduled for a future release. We have a lot of other features that we are planning on adding so it's a little farther back in the queue. I wouldn't expect to see it until late this year or early next.

    0
    Comment actions Permalink
  • Lrockwell

    How did you write the file scanner to pick up the file? I cant figure out how to do it and have tried a lot of options! Please help.

    0
    Comment actions Permalink
  • Michael Muni

    The file scan just scans for C:\SmartStatus\OK.txt if the drive has no smart errors and C:\SmartStatus\ERROR.txt if there is a problem.

    Scan for both of those files and then you can base your reports or dynamic computer groups on if they have the ERROR or OK text file.

    0
    Comment actions Permalink
  • Michael Muni

    Also remember that the file scan is just one part of this, you also need to create a package that runs on a schedule and is what checks the status and creates the files.

    0
    Comment actions Permalink
  • Lrockwell

    So what am I missing? I know the file exists on this machine.

    0
    Comment actions Permalink
  • Michael Muni

    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.

    0
    Comment actions Permalink
  • Michael Muni

    here are my file scans, last one is for S.M.A.R.T. status.

     

    0
    Comment actions Permalink
  • Michael Muni

    ha i just noticed that the last line was redundant and removed it. *.txt should get every text file in the folder.

    0
    Comment actions Permalink
  • Jesse Pereboom

    I am just +1 support for this feature natively.  I will play around with the script in the meantime.  

    0
    Comment actions Permalink
  • Robert Newitt

    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

    :done

     

    Thanks.

     

    0
    Comment actions Permalink
  • Michael Muni

    Sara S, yes that is a better way to do it now that PDQ officially added support.

    They have come a long way.

    0
    Comment actions Permalink

Please sign in to leave a comment.