Subaru Discussion Forums

Go Back   ScoobyNet > Off Topic > Computer Related
New! Use your Facebook to securely log into this site, click logo to login

Computer Related Are you going to build your own computer, or want advice on laptops, notebooks, monitors, processors, motherboard, software, computer games, etc. Discuss all things computer, or seek help from our resident geeks!

Welcome to ScoobyNet.com!
Subaru forum
Welcome to the ScoobyNet.com Subaru forum.

You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, at no cost, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, so please join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Reply
 
Thread Tools
Old 25 August 2009, 15:50   #1
Bravo2zero_sps
Scooby Regular
 
Bravo2zero_sps's Avatar
 
Trader Score: (0)
Join Date: Dec 2001
Location: Scoobless again
Posts: 15,953
Question Best way to check disk space on multiple servers

If I have 100 servers I need to check free disk space on what is the quickest/easiest way?

Scripting (which i'm no good at) or is there software that will do it? Just thought of 'tree size' but can it take a list of names and add them and display the results?
Bravo2zero_sps is offline   Reply With Quote
Old 25 August 2009, 16:39   #2
ChrisB
Moderator
 
Trader Score: (0)
Join Date: Dec 1998
Location: Staffs
Posts: 23,245
Default

There's a PowerShell script here:

Check disk space with Powershell | youdidwhatwithtsql.com

Takes the servers from a TXT, outputs to screen and CSV
ChrisB is offline   Reply With Quote
Old 25 August 2009, 16:59   #3
LostUser
Scooby Regular
 
Trader Score: (0)
Join Date: Oct 2005
Posts: 288
Default

If you ran something like this whilst logged on with an admin account which is the same across all servers it should do the trick

FREE Disks Monitoring Software :: monitor all disks in your Windows network, no trial period, no limits | Free software and tools for Windows 2003 XP 2000 NT

or this

http://4sysops.com/archives/netwrix-disk-space-monitor/

Last edited by LostUser; 25 August 2009 at 17:00.
LostUser is offline   Reply With Quote
Old 25 August 2009, 19:37   #4
HHxx
Part's Collector
 
Trader Score: (0)
Join Date: Nov 2001
Posts: 2,523
Default

Do you not have a monitoring solution in place already?

You can use Openview, Tivoli, Insight Manager, Nagios, Zabbix etc. to do that.
HHxx is offline   Reply With Quote
Old 25 August 2009, 19:54   #5
Bravo2zero_sps
Scooby Regular
 
Bravo2zero_sps's Avatar
 
Trader Score: (0)
Join Date: Dec 2001
Location: Scoobless again
Posts: 15,953
Default

Thanks for the replies. The script will be an issue as I can't go running a script I got off the net on the network or they will have my balls on a plate and the scripter in the team is on 2 weeks leave or I could have got him to do a script or check that one.

HHxx yes but don't have access to it any more and probably all changed, was a script outputting to an excel sheet years ago. We are a projects team now, the BAU stuff got handed over to near shoring in NI 2 years ago and so we aren't in the loop with BAU stuff any more. We've got insight so will go and have a look at that but didn't think I could put a list into that and would still be a manual check of one server at a time?
Bravo2zero_sps is offline   Reply With Quote
Old 25 August 2009, 20:16   #6
HHxx
Part's Collector
 
Trader Score: (0)
Join Date: Nov 2001
Posts: 2,523
Default

By Insight Manager I mean the centralised collector. Think it is called Systems Insight Manager now. It's where the traps are sent to from HP boxes, normally.

If you can't just run scripts nilly willy. How about using the examples on the msdn site for WMI using vbscripts? Feel safer using scripts from MS? (Maybe..)

Or if you know the public snmp string, interrogate the server's OID's?

Build a nice select statement to get the data form your monitoring server's db?

Sorry, I'm reeling off my thought process Hopefully something helps you find a solution

H
HHxx is offline   Reply With Quote
Old 25 August 2009, 21:11   #7
ChrisB
Moderator
 
Trader Score: (0)
Join Date: Dec 1998
Location: Staffs
Posts: 23,245
Default

I've only dabbled in PowerShell (for Exchange 2007 tasks), but it's not that hard to see what the script I linked too is doing...

Code:
# Issue warning if % free disk space is less 
$percentWarning = 15;
# Get server list
$servers = Get-Content "$Env:USERPROFILE\serverlist.txt";
$datetime = Get-Date -Format "yyyyMMddHHmmss";
 
# Add headers to log file
Add-Content "$Env:USERPROFILE\server disks $datetime.txt" "server,deviceID,size,freespace,percentFree";
 
foreach($server in $servers)
{
	# Get fixed drive info
	$disks = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3";
 
	foreach($disk in $disks)
	{
		$deviceID = $disk.DeviceID;
		[float]$size = $disk.Size;
		[float]$freespace = $disk.FreeSpace;
 
		$percentFree = [Math]::Round(($freespace / $size) * 100, 2);
		$sizeGB = [Math]::Round($size / 1073741824, 2);
		$freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
 
		$colour = "Green";
		if($percentFree -lt $percentWarning)
		{
			$colour = "Red";
		}
		Write-Host -ForegroundColor $colour "$server $deviceID percentage free space = $percentFree";
		Add-Content "$Env:USERPROFILE\server disks $datetime.txt" "$server,$deviceID,$sizeGB,$freeSpaceGB,$percentFree";
	}
}
ChrisB is offline   Reply With Quote
Old 26 August 2009, 10:18   #8
Bravo2zero_sps
Scooby Regular
 
Bravo2zero_sps's Avatar
 
Trader Score: (0)
Join Date: Dec 2001
Location: Scoobless again
Posts: 15,953
Default

Thanks for the help, I decided to use powershell and be done with and read up on it here as never used it before

Running Windows PowerShell Scripts

Worked a treat
Bravo2zero_sps is offline   Reply With Quote
Reply

Tags
check, computer, disk, diskspace, free, hp, list, multiple, oid, powershell, script, server, servers, snmp, space


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump



All times are GMT +1. The time now is 17:39.

Contact Us - ScoobyNet - Archive -
Top

Important - Opinions expressed are not necessarily the opinions of ScoobyNet or any individuals directly or indirectly involved in this website or the companies and individuals associated with it. No responsibility is taken or assumed for any comments or statements made on this or any associated or relating bulletin board. Your personal information will be kept private except to comply with applicable laws or valid legal reasons.

LinkBacks Enabled by vBSEO 3.2.0 © 2008, Crawlability, Inc.