Solved

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

Posted on 2014-02-13
7
606 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

830 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