Free drive space

(imported topic written by Casino_Ed)

I have the following statements and I’m trying to get a mesh of the two. I would like the ability to see the free space of other drives on my servers, but the twist is that I’d like to see the ones that are below 10 Percent free… Currently I can determine which machines are below 10 percent on the system drive only.

My current statement:

((significance place

0

of
((free space

of

drive

of

system folder

as
floating point
/
total space

of

drive

of

system folder

as

floating point)

100
))

as

string)

&

" Percent Free"

This is what I’ve found and would like to customize so that I can see the percentage free below 10 percent.

((
if

property

“Description”

of

it

as

string

contains

“Local Fixed Disk”

then
(substring after

“=”

of
(property

“DeviceID”

of

it

as

string)

&

", "

&
(substring after

“=”

of
((property

“FreeSpace”

of

it

as

string))

as

integer

/

1024

/

1024

/

1024
)

as

string

&

“GB Free”
)

else

nothing
)

of

select objects (
“DeviceID,Description,FreeSpace from win32_logicaldisk”
)

of

wmi)

  • ed

(imported comment written by TJessee)

Ed,

I have been able to get the following to work with displaying the free, total and percentage of the drive_fixed

(name

of

it

&

" Free: "

&

(free space

of

it

/
1024

/
1024

/
1024
)

as

string

&

"GB "

&

" Total: "

&

(total space

of

it

/
1024

/
1024

/
1024
)

as

string

&

"GB "

&

" Percent Free: "

&

(free space

of

it

100

/

total space

of

it
)
as

string

&

“”
)

of

drives

whose

(type

of

it

=

“DRIVE_FIXED”
)

You might be able to tweak that to only show you the drives if they are below a certain percentage. Hope this helps a little.

(imported comment written by TJessee)

Ed,

Try this

if (exists drive whose (((((free space of it) * 100)/(total space of it)) < 80) and ((type of it = “DRIVE_FIXED”)))) then ((name of it, ((free space of it) * 100)/(total space of it)) of drives whose (((((free space of it) * 100)/(total space of it)) < 80) and ((type of it = “DRIVE_FIXED”))) as string) else (“No Drives Below Criteria”)

(imported comment written by Casino_Ed)

Thank you! You guys are a great help. I was able to use the following:

(name of it & " Free = " & (free space of it /1024 /1024 /1024) as string & "GB " & " - Total = " & (total space of it /1024 /1024 /1024) as string & "GB " & " - Percent Free = " & (free space of it * 100 / total space of it)as string & “” & “.”) of drives whose (type of it = “DRIVE_FIXED”)

I’ll post the finished file I used for anyone else who is interested.

  • ed

(imported comment written by jgstew)

I’d recommend taking a look at this analysis:
http://bigfix.me/analysis/details/2994572

In particular the property “Spaces of Drives”

(name of it & " - Size: " & ((total space of it /(102410241024)) as string & " GB") & “, Used:(” & (((total space of it - free space of it)100/(total space of it)) as string) & "%25) " & (((total space of it - free spaceof it) /(102410241024)) as string & " GB") & “, Free:(” & (((free space of it)100/(total space of it)) asstring) & "%25) "& ((free space of it /(102410241024)) as string & " GB"
))
of
drives
whose
(
exists
name
of

it

AND
exists
free space
of

it

AND

exists
type
of

it

AND

exists
total space
of

it

AND
type
of

it

=

“DRIVE_FIXED”

AND
total space
of

it

!=

0

AND
total space
of

it

102410241024)