Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8d8b549f0f | ||
|
49a6f65a76 | ||
|
545d790a8b | ||
|
84e409c096 | ||
|
71eeccdd5a |
@ -103,3 +103,56 @@ function ProcessLogToHash {
|
|||||||
)
|
)
|
||||||
ProduceHashMap -Elements $(getElems -Path $Path)
|
ProduceHashMap -Elements $(getElems -Path $Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildIntervals {
|
||||||
|
param (
|
||||||
|
$hash
|
||||||
|
)
|
||||||
|
$array = @()
|
||||||
|
foreach ($key in $hash.Keys){
|
||||||
|
#Write-Host $key
|
||||||
|
$list = $hash.$key
|
||||||
|
#Write-Host $list
|
||||||
|
$lastState = $null
|
||||||
|
$lastTS = $null
|
||||||
|
foreach ($elem in $list){
|
||||||
|
#Write-Host $elem
|
||||||
|
if (($elem.state -eq 'Started') -and ($null -eq $lastState)) {
|
||||||
|
$lastState=$elem.state
|
||||||
|
$lastTS=$elem.ts
|
||||||
|
}
|
||||||
|
if (($elem.state -ne 'Started') -and ($lastState -eq 'Started')) {
|
||||||
|
$array += @(New-Object psobject -Property @{
|
||||||
|
begining=$lastTS
|
||||||
|
ending=$elem.ts
|
||||||
|
state=$elem.state
|
||||||
|
vm=$key
|
||||||
|
})
|
||||||
|
$lastState=$null
|
||||||
|
$lastTS=$null
|
||||||
|
}
|
||||||
|
#Write-Host "$array"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $array
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetAffected {
|
||||||
|
param (
|
||||||
|
$listOfIntervals,
|
||||||
|
[datetime]$point,
|
||||||
|
[switch] $verbose
|
||||||
|
)
|
||||||
|
$array = @()
|
||||||
|
foreach ($elem in $listOfIntervals){
|
||||||
|
if ($point -le $elem.ending -and $point -ge $elem.begining){
|
||||||
|
if ($verbose) {
|
||||||
|
Write-Host "$point : $($elem.vm) $($elem.state)"
|
||||||
|
}
|
||||||
|
if(!$array.Contains($elem.vm)){
|
||||||
|
$array += @($elem.vm)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $array
|
||||||
|
}
|
@ -13,3 +13,13 @@ snrdaoeisnrdaoie:2024-02-06 20:00:00 some other Harddrive operation
|
|||||||
snrdaoeisnrdaoie: VMware-Maschine 'test2'
|
snrdaoeisnrdaoie: VMware-Maschine 'test2'
|
||||||
snrdaoeisnrdaoie:aoei aoei VMware-Maschine 'test2'
|
snrdaoeisnrdaoie:aoei aoei VMware-Maschine 'test2'
|
||||||
snrdaoeisnrdaoie:2024-02-06 21:00:00 VMware-Maschine 'test2'
|
snrdaoeisnrdaoie:2024-02-06 21:00:00 VMware-Maschine 'test2'
|
||||||
|
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:00:00 gestartet VMware-Maschine 'test'
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:00:00 gestartet VMware-Maschine 'test'
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:00:00 some harddrive operation
|
||||||
|
nsriadoeisnrdaoei
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:00:00 some other Harddrive operation
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:01:00 VMware-Maschine 'test' Erfolgreiche
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:01:00 VMware-Maschine 'test' Erfolgreiche
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:01:00 VMware-Maschine 'test'
|
||||||
|
snrdaoeisnrdaoie:2024-02-06 20:00:00 gestartet VMware-Maschine 'test2'
|
Loading…
Reference in New Issue
Block a user