Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Improved Drive Space Monitoring Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2008 9:47 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:43 PM
Points: 23, Visits: 129
Comments posted to this topic are about the item Improved Drive Space Monitoring


Post #458349
Posted Thursday, February 21, 2008 4:28 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 1, 2014 6:18 AM
Points: 1,618, Visits: 20,980
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
Post #458460
Posted Thursday, February 21, 2008 8:00 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 11:30 AM
Points: 471, Visits: 848
what is the purpose of replacing xp_fixeddrives with a call to xp_cmdshell. I would prefer to have xp_cmdshell disabled.
Post #458559
Posted Thursday, February 21, 2008 8:59 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:43 PM
Points: 23, 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..


Post #458612
Posted Thursday, February 21, 2008 9:07 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:06 PM
Points: 54, Visits: 323
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?
Post #458619
Posted Thursday, February 21, 2008 10:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:43 PM
Points: 23, 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.



Post #458671
Posted Thursday, February 21, 2008 10:31 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:06 PM
Points: 54, Visits: 323
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...
Post #458683
Posted Thursday, February 21, 2008 11:02 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:43 PM
Points: 23, Visits: 129
Great! Glad the script is running on your 64 bit system.
Can you share the code that handles CDROM??:)



Post #458709
Posted Thursday, February 21, 2008 11:38 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:06 PM
Points: 54, Visits: 323
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
Post #458735
Posted Thursday, February 21, 2008 12:04 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 24, 2014 2:43 PM
Points: 23, Visits: 129
Thanks. We will look at adding this because CDROM Drives do not interest us at all


Post #458744
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse