Hi,
I am running OpManager 9.0. Is it possible to monitor the disk space for a Hyper-V failover cluster CSV disk (cluster Shared Volume)?
If so can anyone provide further information?
I already have a powershell script that will list the free space, used space and percent free but I want to be alerted in OpManager when the threshold falls below 100GB (attention), 75GB (trouble), 50GB (critical).
Here is the powershell script:
Import-Module FailoverClusters
$objs = @()
$csvs = Get-ClusterSharedVolume
foreach ( $csv in $csvs )
{
$csvinfos = $csv | select -Property Name -ExpandProperty SharedVolumeInfo
foreach ( $csvinfo in $csvinfos )
{
$obj = New-Object PSObject -Property @{
Name = $csv.Name
Path = $csvinfo.FriendlyVolumeName
Size = $csvinfo.Partition.Size
FreeSpace = $csvinfo.Partition.FreeSpace
UsedSpace = $csvinfo.Partition.UsedSpace
PercentFree = $csvinfo.Partition.PercentFree
}
$objs += $obj
}
}
$objs | ft -auto Name,Path,@{ Label = "Size(GB)" ; Expression = { "{0:N2}" -f ($_.Size/1024/1024/1024) } },@{ Label = "FreeSpace(GB)" ; Expression = { "{0:N2}" -f ($_.FreeSpace/1024/1024/1024) } },@{ Label = "UsedSpace(GB)" ; Expression = { "{0:N2}" -f ($_.UsedSpace/1024/1024/1024) } },@{ Label = "PercentFree" ; Expression = { "{0:N2}" -f ($_.PercentFree) } }
The powershell script output is shown below:
Name Path Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree
---- ---- -------- ------------- ------------- -----------
CSV Disk 1 C:\ClusterStorage\Volume1 2,047.89 197.87 1,850.01 9.66
CSV Disk 2 C:\ClusterStorage\Volume2 1,023.89 158.35 865.54 15.47