Relevance for Windows Servers with Low Disk

(imported topic written by Gallus2391)

Hi all, can you help ?

I’d like to run an analysis that is relevant for servers with less then 20% free on any of its fixed drives. I have the below but

if (((free space of it / total space of it as floating point) * 100) of drives whose (type of it = “DRIVE_FIXED”) < 20 ) then (“True”) else (“False”)

but I’m getting an error " A singular expression is required." I assume thats because I’m getting multiple responses from servers.

I’m trying to get a list of servers that have low space onto a web report and emailed to their owners on a regular basis.

Thanks

(imported comment written by MattBoyd)

Gallus23

but I’m getting an error " A singular expression is required." I assume thats because I’m getting multiple responses from servers.

You are correct. This is because of the plural “drives” in your relevance clause. It will return the size of every drive on the system, which cannot be evaluated through an if statement. There are several ways that I can think of at the moment that will fix this and there may be other solutions as well.

If you want to check the drive space of a particular drive (with a letter):

if ((((free space of it / total space of it as floating point) * 100) < 20) of drive “C:” whose (type of it = “DRIVE_FIXED”) ) then (“True”) else (“False”)

If you want to check the drive space of the SYSTEM drive (since it’s not necessarily “C:” on every machine):

if ((((free space of it / total space of it as floating point) * 100) < 20) of (drive of system folder) whose (type of it = “DRIVE_FIXED”) ) then (“True”) else (“False”)

If you want to return all drive letters that have less than x space, you could eliminate the IF statement and just return a list of drives with less than 20% free space:

names of drives whose ((type of it = “DRIVE_FIXED”) and ((free space of it / total space of it as floating point ) * 100 < 20))

I hope that helps.

(imported comment written by Gallus2391)

Thats great. Thanks very much…

(imported comment written by tazmir91)

Hi, how can I use

names of drives whose (type of it = “DRIVE_FIXED”)

and also obtain Total, used, and free space (MB) in all drive letters in the output.

Thanks

This works well for me since not all C drive is noted as System Drive in our environment

(((free space of it / total space of it as floating point) * 100) < 20) of (drive of system folder) whose (type of it = “DRIVE_FIXED”)