Solved

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

Posted on 2014-02-13
7
584 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
7 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
Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 

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 500 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 Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now