citrix-pvs-healthcheck icon indicating copy to clipboard operation
citrix-pvs-healthcheck copied to clipboard

PVS Server "MemUsg" is showing U instead of the % of memory used

Open ryanchauvin opened this issue 7 years ago • 4 comments

This started happening on the change on 2017-05-22 (proposed fix for Issue #16). I am currently using PowerShell v5 when I experience the U issue showing instead of the % of memory used.

ryanchauvin avatar Jun 13 '17 13:06 ryanchauvin

I put the old code back and it works now.

Function CheckMemoryUsage() { param ($hostname) Try { $SystemInfo = (Get-WmiObject -computername $hostname -Class Win32_OperatingSystem -ErrorAction Stop | Select-Object TotalVisibleMemorySize, FreePhysicalMemory) $TotalRAM = $SystemInfo.TotalVisibleMemorySize/1MB $FreeRAM = $SystemInfo.FreePhysicalMemory/1MB $UsedRAM = $TotalRAM - $FreeRAM $RAMPercentUsed = ($UsedRAM / $TotalRAM) * 100 $RAMPercentUsed = "{0:N2}" -f $RAMPercentUsed return $RAMPercentUsed } Catch { "Error returned while checking the Memory usage. Perfmon Counters may be fault" | LogMe -error; return 101 } }

digitlman avatar Aug 11 '17 11:08 digitlman

does not work for me. After applying your suggested code change the report shows "R" instead of "U" in the column "MemUSG"

loefflerman avatar Feb 26 '18 11:02 loefflerman

It doesn't work for me either

ryanchauvin avatar Feb 26 '18 14:02 ryanchauvin

changes lines 424-428 once using the following example: if( $UsedMemory -lt 0.75) { "Memory usage is normal [ {0:p2} ]" -f $UsedMemory | LogMe -display; $PVStests.MemUsg = "SUCCESS", ("{0:p2}" -f $UsedMemory)} then it should also work with Powershell 5.1. HTH Andreas

amuenzberg avatar Mar 21 '18 10:03 amuenzberg