VMlogix is a piece of shit.

vmlogix is a piece of shit, it crashes, explodes, and just does a bad job at life.

here is a script to detect with it explodes (and it will) by using the cpu values, if the rp is less then 9Ghz, it reboots it.

i have this a task to check every 30 mins for now, will probably change it to 15 when i feel like it

[powershell]#script to reboot labman if cpu useage is lower then expected.
#maybe.
connect-viserver atl-mis-vc01.eclipsys.lan
$uptimeweee = (get-stat -entity (get-vm atl-vmlm01) -stat sys.uptime.latest -maxsample 1 -realtime).Value
if ($uptimeweee -ge 1800){
$cpuuse = (Get-Stat -entity (Get-ResourcePool "LabManager-RP") -Stat cpu.usagemhz.average -MaxSamples 75 -realtime | Measure-Object Value -Average)
$cpuuse = $cpuuse.Average
Write-Host $cpuuse
if ($cpuuse -le 9500){
get-vapp LabManager | stop-vapp -Confirm:$false -ErrorAction:SilentlyContinue
sleep 30
get-vapp LabManager | start-vapp -Confirm:$false -ErrorAction:SilentlyContinue
}}
else {Write-Host "Not up long enough!"}
Disconnect-VIServer -Confirm:$false[/powershell]

WordPress Themes