icinga-powershell-plugins icon indicating copy to clipboard operation
icinga-powershell-plugins copied to clipboard

Invoke-IcingaCheckDiskHealth - missing HealthStatus

Open tectumopticum opened this issue 10 months ago • 0 comments
trafficstars

The description of this plugins says "Checks the state, accessibility and usage of a physical disk." This should also include the "physical health" or integrity of the disks structure (e.g. NTFS-issues). You can check this with the cmdlet "get-volume" where the output shows something like

DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus  SizeRemaining       Size
----------- --------------- ---------- --------- ------------ -----------------  -------------       ----
                            NTFS       Fixed     Healthy      OK                     104.13 MB     450 MB
C                           NTFS       Fixed     Warning      Full Repair Needed     720.33 GB  930.93 GB
            CSV_SYS_011     CSVFS      Fixed     Healthy      OK                     817.98 GB     2.1 TB
            CSV_DAT_106     CSVFS      Fixed     Healthy      OK                       3.18 TB     4.1 TB

A "HealthStatus" != "Healthy" should be reported, probably in combination with "OperationalStatus" != "In Maintenance Mode" (I've already seen "Warning" and "Op

Alternative methods:

Get-PhysicalDisk | Select FriendlyName, SerialNumber, OperationalStatus, HealthStatus, Usage, Size, AllocatedSize, VirtualDiskFootprint
FriendlyName         : HP LOGICAL VOLUME
SerialNumber         : XYZHUGOEGONFOO123
OperationalStatus    : OK
HealthStatus         : Healthy
Usage                : Auto-Select
Size                 : 1000171331584
AllocatedSize        : 1000171331584
VirtualDiskFootprint : 0

FriendlyName         : ATA DB01234567ABCD
SerialNumber         : FOO12345XYZ
OperationalStatus    : In Maintenance Mode
HealthStatus         : Warning
Usage                : Journal
Size                 : 1920118816768
AllocatedSize        : 1888711868416
VirtualDiskFootprint : 2147483648
[...]

BTW: the wmi-class "diskdrive" doesn't reflect appropriate status-values. Unlike reporting a "Warning" as "get-volume" or "get-PhysicalDisk" does in the example shown above, it reports only "OK". Currently I can't recommend a good low-level-method for checking the healthStatus.

tectumopticum avatar Jan 21 '25 14:01 tectumopticum