centreon-plugins icon indicating copy to clipboard operation
centreon-plugins copied to clipboard

enh(windows/local): add storage mode, update list-storages powershell

Open cgagnaire opened this issue 1 year ago • 2 comments

Adds a new local mode for Windows for storages check. Moreover, it changes the powershell code to use Win32_Volume instead of Win32_LogicalDisk to list the mount points in addition to the disks.

perl centreon_plugins.pl --plugin=os::windows::local::plugin --mode=storage --filter-counters='usage' --verbose
OK: All storages are ok | 'C:#storage.space.usage.bytes'=126149279744B;;;0;192746090496 'C:\mountpoints\toto\#storage.space.usage.bytes'=28842065920B;;;0;85864677376 'D:#storage.space.usage.bytes'=1192564555776B;;;0;2254722498560 
Storage 'C:' Usage Total: 179.51 GB Used: 117.49 GB (65.45%) Free: 62.02 GB (34.55%)
Storage 'C:\mountpoints\toto\' Usage Total: 79.97 GB Used: 26.86 GB (33.59%) Free: 53.11 GB (66.41%)
Storage 'D:' Usage Total: 2.05 TB Used: 1.08 TB (52.89%) Free: 989.21 GB (47.11%)

cgagnaire avatar Dec 14 '23 15:12 cgagnaire

Hi @cgagnaire, Thanks for your PR! Can you confirm that the names listed by the Win32_Volume function instead of the Win32_LogicalDisk will be usable by the check_drivesize builtin and not only by your new mode?

omercier avatar Feb 27 '24 09:02 omercier

Hi, For the drives yes, it returns the name like "Q:" as shown in the example.

cgagnaire avatar Feb 29 '24 17:02 cgagnaire