mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 14:44:43 +02:00
+ Fix hyperv node-snapshot
This commit is contained in:
parent
0419edde14
commit
40a835e133
@ -58,10 +58,14 @@ Try {
|
|||||||
if ($vm.status -imatch "Backing") {
|
if ($vm.status -imatch "Backing") {
|
||||||
$VMDisks = Get-VMHardDiskDrive -VMName $vm.VMName
|
$VMDisks = Get-VMHardDiskDrive -VMName $vm.VMName
|
||||||
Foreach ($VMDisk in $VMDisks) {
|
Foreach ($VMDisk in $VMDisks) {
|
||||||
if ($VMDisk.Path -imatch ".avhdx" -or $VMDisk.VhdType -imatch "Differencing") {
|
$VHD = Get-VHD $VMDisk.Path
|
||||||
$vhd = Get-VHD $VMDisk.Path
|
if ($VHD.Path -imatch ".avhdx" -or $VHD.VhdType -imatch "Differencing") {
|
||||||
$parent = Get-Item $vhd.ParentPath
|
$parent = Get-Item $VHD.ParentPath
|
||||||
|
if ($i -eq 0) {
|
||||||
|
Write-Host "[name=" $vm.VMName "][state=" $vm.State "][note=" $note "]"
|
||||||
|
}
|
||||||
Write-Host "[checkpointCreationTime=" (get-date -date $parent.LastWriteTime -UFormat ' . "'%s'" . ') "]"
|
Write-Host "[checkpointCreationTime=" (get-date -date $parent.LastWriteTime -UFormat ' . "'%s'" . ') "]"
|
||||||
|
$i=1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user