ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   Best way to check disk space on multiple servers (https://www.scoobynet.com/computer-and-technology-related-34/785804-best-way-to-check-disk-space-on-multiple-servers.html)

Bravo2zero_sps 25 August 2009 03:50 PM

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?

ChrisB 25 August 2009 04:39 PM

There's a PowerShell script here:

Check disk space with Powershell | youdidwhatwithtsql.com

Takes the servers from a TXT, outputs to screen and CSV

LostUser 25 August 2009 04:59 PM

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/

HHxx 25 August 2009 07:37 PM

Do you not have a monitoring solution in place already?

You can use Openview, Tivoli, Insight Manager, Nagios, Zabbix etc. to do that.

Bravo2zero_sps 25 August 2009 07:54 PM

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?

HHxx 25 August 2009 08:16 PM

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:wonder: Hopefully something helps you find a solution :)

H

ChrisB 25 August 2009 09:11 PM

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";
        }
}


Bravo2zero_sps 26 August 2009 10:18 AM

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 :thumb:


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


© 2024 MH Sub I, LLC dba Internet Brands