What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

how to check hard disk space, and analysis of that output in command prompt?




i want to check the free space of hard disk, if free space is less than 50% of totalspace avilable, then it sends a mail or message to the mobile. this is used for continuous monitoring of free space. by the using of COMMAND PROMPT, BATCH FILE, or VBS script.

wmic logicaldisk where name='G:' name=get size,freespace,caption

above statement gives the freespace of particular disk. the main problem is that how to take the the freespace on a new variable, to perform the analysis on that data.

disk freespace wmic

Created on May 28, 2013 7:57:45 AM

2 Replies



What you could do for this would be to query WMI for the PercentFreeSpace for that drive then use that query in a Custom WMI Sensor. Once you have that sensor created, you can create custom limits for that channel to alert when that percentage falls below 50%.

The WQL Query would look like this

SELECT PercentFreeSpace FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name='G:'

You would create a wql file with this in it, then put that in the Custom Sensors directory under \PRTG Network Monitor\Custom Sensors\WMI WQL scripts

Then create your sensor with that query that was built on the device you want to monitor. This will return the percentage of free space on the disk and then you can edit the channel settings to have limits on that number so that when it's below a certain amount it can go into a warning or error state. Channel Settings

Created on May 28, 2013 9:44:31 AM by  Greg Campion [Paessler Support]



PRTG has a standard sensor for this.

From the manual:

The WMI Free Disk Space (Multi Drive) sensor monitors the free disk space of one or multiple drive(s) using Windows Management Instrumentation (WMI). It shows the space in percent and total. One single sensor is used for all drives; the data is presented in different channels.

Created on May 28, 2013 11:43:26 AM

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.