Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-02-13
7
Medium Priority
?
623 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 

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

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
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.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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