Free Disk space and Total Disk space for fixed drives

(imported topic written by jpeppers91)

I am trying to determine the free and total disk space on fixed drives. I found the relevance on the Bigfix site but some of the machines are reporting the data, some are reporting “none” and others “Singular expression refers to nonexistent object”

Here is the relevance…

Free space

(name of it & " - " & (free space of it / 1000 / 1000) as string & " MB") of drives whose (type of it = “DRIVE_FIXED”)

Total space

(name of it & " - " & (total space of it / 1000 / 1000) as string & " MB") of drives whose (type of it = “DRIVE_FIXED”)

Can anyone explain why it will work for some and not others?

(imported comment written by Lee Wei)

It is likely that some drives are having problems reporting their free space or total space. For example, a drive of type CDROM cannot report free/total space if there is no media inserted.

So we can try making sure that the attributes exist:

Free space

(name of it & " - " & (free space of it / 1000 / 1000) as string & " MB") of drives whose (type of it = “DRIVE_FIXED” and exists free space of it)

Total space

(name of it & " - " & (total space of it / 1000 / 1000) as string & " MB") of drives whose (type of it = “DRIVE_FIXED” and exists total space of it)

1 Like

(imported comment written by jpeppers91)

There isn’t a common denominator as to why some works and some don’t.

(imported comment written by brolly3391)

Hello jpeppers,

This might give some insight as to what piece is failing:

((if (exists name of it) then (name of it) else (“Drive has no Name”)) & " - " & (if (exists free space of it) then ((free space of it /1024/1024)as string & " MB") else (“Drive has no Free Space”)) & " - " & (if (exists type of it) then (type of it as string) else (“Drive has no Type”))) of drives

We can even take it one step further and make sure at least one drive exists:

if (exists drive) then (((if (exists name of it) then (name of it) else (“Drive has no Name”)) & " - " & (if (exists free space of it) then ((free space of it /1024/1024)as string & " MB") else (“Drive has no Free Space”)) & " - " & (if (exists type of it) then (type of it as string) else (“Drive has no Type”))) of drives ) else (“No drives found”)

Cheers,

Brolly

1 Like

(imported comment written by jcsUTSW)

How can I get used and free space for each drive?

(imported comment written by Lee Wei)

jcsUTSW

How can I get used and free space for each drive?

jcsUTSW,

Please see if this will work for you:

(name of it & " - " & (free space of it / 1000 / 1000) as string & " MB free of " & (total space of it / 1000 / 1000) as string & " MB total") of drives whose (type of it = “DRIVE_FIXED”)

I got this from the following web page on the BigFix Support site. Scroll to the File section.

http://support.bigfix.com/bes/misc/retrievedproperties.html

Lee Wei