Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Best way to check disk space on multiple servers

Thread Tools
 
Search this Thread
 
Old 25 August 2009, 04:39 PM
  #2  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
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
Old 25 August 2009, 04:59 PM
  #3  
LostUser
Scooby Regular
 
LostUser's Avatar
 
Join Date: Oct 2005
Posts: 476
Likes: 0
Received 0 Likes on 0 Posts
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 05:00 PM.
Old 25 August 2009, 07:37 PM
  #4  
HHxx
Scooby Regular
 
HHxx's Avatar
 
Join Date: Nov 2001
Posts: 2,576
Likes: 0
Received 0 Likes on 0 Posts
Default

Do you not have a monitoring solution in place already?

You can use Openview, Tivoli, Insight Manager, Nagios, Zabbix etc. to do that.
Old 25 August 2009, 08:16 PM
  #6  
HHxx
Scooby Regular
 
HHxx's Avatar
 
Join Date: Nov 2001
Posts: 2,576
Likes: 0
Received 0 Likes on 0 Posts
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 *****. 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
Old 25 August 2009, 09:11 PM
  #7  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
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";
	}
}
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
Ganz1983
Subaru
5
02 October 2015 09:22 AM
thunder8
General Technical
0
01 October 2015 09:13 PM



Quick Reply: Best way to check disk space on multiple servers



All times are GMT +1. The time now is 12:02 AM.