Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need to modify vbs script which gets S.M.A.R.T. drive status

Posted on 2014-02-13
7
Medium Priority
?
632 Views
Last Modified: 2014-02-20
I'm attaching a .vbs script I got from another site. I changed the extension to .txt. The script displays a dialog showing the local computer name but you can change that to the name of a computer on the LAN and it will return something like the following:

[computername] reports no S.M.A.R.T issues with the device"
'IDE\DisksST3160318AS______________________________CC45____________\4&167da70f&0&0.9.0
_0'.

I want to change the script so it does the following:
1. Pulls the names of computers from a file that contains a list of computer names, computers.txt.
2. Outputs the status to SMART Status.csv.
3. According to Wikipedia S.M.A.R.T. returns one of two responses,  "threshold not exceeded" and "threshold exceeded". If so then that is what I want in the .csv file. Regardless, I just want the basic info indicating if S.M.A.R.T. thinks the drive is failing.
4. If the drive or PC does not support S.M.A.R.T. data then the script should return. "not supported" for that particular machine.
5. The script should work with remote computers running Windows 7 and Windows XP.

Thanks,
Don
SmartStatus.txt
0
Comment
Question by:donander
  • 4
  • 2
6 Comments
 

Author Comment

by:donander
ID: 39859449
Cool. I looked for but could not find that zone.
Thanks!
Don
0
 

Author Comment

by:donander
ID: 39859459
I just realized there should also be an output if the machine is not reachable, so the four possible outputs would be:

1. Threshold not exceeded
2. Threshold exceeded
3. SMART not supported
4. Computer not found

Thanks,
Don
0
 
LVL 8

Expert Comment

by:TheNautican
ID: 39863387
Hey Don I worked this up and on my small network at home it works fine. Let me know how it works out for you and what tweaks you may want.

Regards,
-Naut
Q28364367.vbs
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

Author Comment

by:donander
ID: 39874478
Sorry for the delay in giving feedback. This script basically works. I'd like have the following changes made but if that is not possible then I can parse the output in its current format and will be happy to accept Naut's comment as the answer.

If the computer has no issues the script has this output. Note I have replaced the actual computer name with MYCOMPUTER.

MYCOMPUTER,Online,'MYCOMPUTER' reports no S.M.A.R.T. issues with device 'IDE\DiskST3250312AS_____________________________JC47____\4&3e91c9e&0&0.0.0_0'.

It would be nice to have instead just

MYCOMPUTER Passed

If S.M.A.R.T. is not supported you get

MYCOMUTER,Online,Drive(s) on MYCOMPUTER not currently enabled or drive configuration is incompatible for S.M.A.R.T. scanning.

it would be nice to have

MYCOMPUTER S.M.A.R.T. not supported.

I only did a test with about 50 computers and have not found any that did have issues so I can't say what the output is for that but I will try to do a test with several hundred computers today or tomorrow and maybe find some but I guess I hope there are none because I don't want any of them to be failing. Sort of a Catch-22 I guess :-)

Thanks,
Don
0
 
LVL 8

Accepted Solution

by:
TheNautican earned 2000 total points
ID: 39874753
Don - Try this.

-Naut
Q28364367.vbs
0
 

Author Closing Comment

by:donander
ID: 39874851
The most recent script is excellent. This only leaves a small amount of post-scan parsing and I can easily do that. Naut is truly a VB Script Master!

Thanks very much!
Don
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Six Sigma Control Plans
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question