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


Disk Capacities


Disk Capacities

Author
Message
Zksod
Zksod
SSC Rookie
SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)

Group: General Forum Members
Points: 49 Visits: 377
Comments posted to this topic are about the item Disk Capacities
nimmagaddakrupanandh
nimmagaddakrupanandh
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 220
Hi,
when ever i executed this script i am getting errors.
i am not getting o/p.
can you help me on this??

please check the errors below.

Msg 102, Level 15, State 1, Line 6
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 27
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 51
Incorrect syntax near ' '.
Perry Whittle
Perry Whittle
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8843 Visits: 16579
Drop the cursors and the calls to xp_fixeddrives and fsutil and use the following

wmic volume get capacity, "free space", name



-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
rw_ebox
rw_ebox
Valued Member
Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)

Group: General Forum Members
Points: 61 Visits: 405
A nice script.

Thanks



nealz
nealz
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 38
Hi, will this give results for all storage volumes and virtual drives associated with a NAS and VMs respectively, or is this for the drives on the machine (virtual or otherwise) which runs the SQL Server Db engine? Thanks!
terry.home
terry.home
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 188
I also got the line errors

when you copy and paste the script from the webbrowser (firefox in my case) into SSMS it does not seem to work.

I have now copied and pasted the text into notepad++ which revealed many of the spaces are defined as square boxes which normally refer to unrecognised text.

By doing a search and replace on all these square boxes and replacing them with a spacebar character, then copying and pasting this from notepad ++ into SSMS worked just fine.

This is a useful script for SQL Admins that if implemented correctly could help them check or even warn them when their SQL servers run out of disk space. However I normally find most organisations that run sql servers, also run other non sql servers and will have some means of monitoring disk space on all the servers.

Writing your own to monitor disk space, whilst fun, might suggest you have already been at the short end of the stick because they have not warned you about disk space shortage and you had a server stop responding because of lack of disk space.

As other servers on the network are quite often also bussiness critical, I would think it makes more sense ensuring the tool used for monitoring disk space accross the board (not just sql servers) is used instead.

Alternatively, since you are using cmdshell, why not setup scheduled tasks on all servers (not just SQL) that run at regular intervals, running batch files to collect the same information and placing it into one SQL server where reporting services can be used to send you a regular email of all servers (not just SQL) where disk space is below either 1GB or 1% of capacity.

T
Zksod
Zksod
SSC Rookie
SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)

Group: General Forum Members
Points: 49 Visits: 377
Hi Guys

This is very weird...

I believe I wrote this about 4/5 years ago and submitted it back then to SQLServerCentral... I have no idea why it is popping up now as a script of the day.

It is a little dated and a lot less relevant now days.

Heck, this info is now available in a quick query to to SQL's dmv's.

Strange?

Anyway, Happy SQL Adventuring!
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