Page 1 of 1

Audit Check disk space

Published: June 4, 2019 - 3:49 PM
by Mathieu
Hello,

I'm trying to create an audit package to check disk space on our partitions.

I found the wmi key `host_metrics`, `local_drive`, `C`, `FreeSpace`, but I don't understand how to use it in the package. I think I need to use `wmi_info`, but I can't find the correct syntax.

Re: Audit Check disk space

Published: June 5, 2019 - 8:58 AM
by sfonteneau
By exploring the code of wapt (common.py) we can find an example:

Code: Select all

free_disk_space = setuphelpers.get_disk_free_space(setuphelpers.programfiles)
if free_disk_space < entry.installed_size:
    raise EWaptDiskSpace('This package requires at least %s free space. The "Program File"s drive has only %s free space' %
                        (format_bytes(entry.installed_size),format_bytes(free_disk_space)))

Re: Audit Check disk space

Published: June 5, 2019 - 09:03
by Mathieu
Ah, thank you, I didn't think to look on the common side