Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Improved Drive Space Monitoring


Improved Drive Space Monitoring

Author
Message
markenash
markenash
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 129
Comments posted to this topic are about the item Improved Drive Space Monitoring



Adiga
Adiga
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2412 Visits: 21012
Hi Mark,

Thanks a ton for this wonderful article. This is exactly what I was looking for since a very long time !

I am trying to build the .vbs file (which you provided in this article) in SQL itself. I mean I would like to build SAY, C:\Pradeep.vbs file by running a query in QA. I would greatly appreciate your help on this.

- Pradeep

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
BJ Hermsen
BJ Hermsen
Mr or Mrs. 500
Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)Mr or Mrs. 500 (521 reputation)

Group: General Forum Members
Points: 521 Visits: 880
what is the purpose of replacing xp_fixeddrives with a call to xp_cmdshell. I would prefer to have xp_cmdshell disabled.
markenash
markenash
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 129
As we understand, 'xp_fixeddrives' was really an unofficial xp and we were unsure how long it would be available. So, when we changed the original procedure for SQL 2005 Database Mail we stopped using it. It is totally up to you which method you use, both work..



john.danley
john.danley
SSC Journeyman
SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)

Group: General Forum Members
Points: 84 Visits: 343
It seems that the vb script won't run on a 64 bit server. Either that or I don't have some configuration right. Is there a work around for this?
markenash
markenash
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 129
Sorry to say we have no 64 bit servers yet, so I have not run into this issue. I did a web search on 'running vbs scripts on 64 bit servers' and got a lot of hits discussing this problem. There were several solutions for different problems. I can only suggest you look into these solution as I can not reproduce this problem here....

Good luck.



john.danley
john.danley
SSC Journeyman
SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)

Group: General Forum Members
Points: 84 Visits: 343
I realized my problem had nothing to do with 64bit vs 32bit. I had to copy out the code, create a new file on the root of c with no spaces, dashes or underscores, then paste the script into this file. Then I setup the job step as type "Operating System (CmdExec)" and set the command to "call C:\MonitorDriveSpace.vbs" (the quotes were not part of the actual command). I did also add an exception in the script to skip the CDRom as I don't really care to be notified if it has 0% free space which it does because someone left a cd in the drive. On the other hand it does let me know that there is a cd in there...
markenash
markenash
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 129
Great! Glad the script is running on your 64 bit system.
Can you share the code that handles CDROM??Smile



john.danley
john.danley
SSC Journeyman
SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)

Group: General Forum Members
Points: 84 Visits: 343
Of course! Actually I cheated originally and just added AND DiskDrive.DriveLetter <> "D" in the For Each loop. To make the code independent of each machine's actual setup I changed this to If DiskDrive.IsReady AND DiskDrive.DriveType <> 4 Then. However now that I think about it I'm not sure I want to know about any drive if it isn't a fixed drive. So I'll change this to If DiskDrive.IsReady AND DiskDrive.DriveType = 2 Then. This site provided good info on the subject: http://www.brettb.com/VBScriptDrivesCollection.asp
markenash
markenash
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 129
Thanks. We will look at adding this because CDROM Drives do not interest us at all :-)



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search