Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8d8b549f0f | ||
|
49a6f65a76 | ||
|
545d790a8b | ||
|
84e409c096 | ||
|
71eeccdd5a |
@ -102,4 +102,57 @@ function ProcessLogToHash {
|
|||||||
$Path
|
$Path
|
||||||
)
|
)
|
||||||
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
|
||||||
}
|
}
|
@ -12,4 +12,14 @@ snrdaoeisnrdaoie:2024-02-06 20:00:00 some harddrive operation
|
|||||||
snrdaoeisnrdaoie:2024-02-06 20:00:00 some other Harddrive operation
|
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