Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for an easy way to monitor free disk space on a large number of servers.
I would also like to be able to count files in certain folders on those servers

share|improve this question
up vote 3 down vote accepted

From create a file C:\Computers.txt with the names of the machines you wish to check, then execute this PowerShell script:

Get-Content C:\Computers.txt | 
ForEach-Object { 
  $_; Get-WMIObject –computername $_ 
  Win32_LogicalDisk -filter "DriveType=3" |
  ForEach-Object { 
    $_.DeviceID; $_.FreeSpace/1GB

You may wish to re-format that; it's pretty ugly, but works ;)

Edit: of course, you'll need to have appropriate security privileges to query other machines.

share|improve this answer

Your answer lies in Powershell but I lack the programming knowledge in that language to give you an exact solution

share|improve this answer

I think it depends on what you're using for a monitoring system. Nagios has NSC++, you can always setup a Windows based snmpd, and various commercial monitoring software packages provide other agents for you to install.

Do you have a monitoring system up and running yet, or is that what your goal is?

share|improve this answer

Zenoss is a good tool combined with SNMP informant. Another that costs money would be PRTG. Both are very easy web based systems to set up. Zenoss comes as a preconfigured virtual machine also that can be easily used.

share|improve this answer

We use ServersAlive to handle our monitoring. Has builtin disk space and files in folder monitoring.

share|improve this answer

Counting the number of files in a directory will require scripting but you can use perfmon to monitor disk space. You can also have it alert you if certain thresholds are met. You can use perfmon on a central system and connect it to your servers so all the monitoring is performed in one location.

share|improve this answer

To count files (from the command line) see

What do you plan to do with the disk space figures? For example will you be running regular queries of them to generate reports? I have a similar requirement, and I use a mix of batch files and VBScript to write the figures into a SQL database. That allows me to generate warnings when disk space is low, but also to track disk usage over time and even predict when disks will fill up.

John Rennie

share|improve this answer

I've been using diskmonitor pro for a few months, its cheap and does the job well.

Got it from

Hope this helps.

share|improve this answer

The 'easy way' as far as I'm concerned is to turn on SNMP, and poll each server from a Nagios box. You'll then not only be able to monitor disk space, but many other aspects including (but not limited to) CPU usage, processes, services, memory, network I/O, hardware, etc.

It's a no brainer if you know Nagios :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.