New-UDMonitor Issues

Hello Folks,

I’m trying to work with New-UDMonitor and when using the following code New-UdMonitor -Title "CPU (% processor time)" -Type Line -DataPointHistory 20 -RefreshInterval 10 -ChartBackgroundColor '#80FF6B63' -ChartBorderColor '#FFFF6B63' -Endpoint { try { Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 1 -MaxSamples 1 -ComputerName $DeviceName -ErrorAction SilentlyContinue | Select-Object -ExpandProperty CounterSamples | Select-Object -ExpandProperty CookedValue | Out-UDMonitorData } catch { 0 | Out-UDMonitorData } }

and every single time I load the dynamic page that have this code the powershell windows close like UD crashes and nothing relevant is raised in the logs and I can’t figure out why it behave like this.

Any ideas ?

Crazy! Can you look in event viewer? It might have more information on the app crash.

There is nothing relevant in the event viewer :frowning:

I’m using version 2.6.0 btw, if it may help

edit : Sometimes it works, sometimes it makes the whole thing crash. it’s getting really weird :confused:

pls try this:

New-UdMonitor -Title "CPU (% processor time)" -Type Line -DataPointHistory 20 -RefreshInterval 10 -ChartBackgroundColor '#80FF6B63' -ChartBorderColor '#FFFF6B63' -Endpoint { 
    try { 
        $counter = (Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 1 -MaxSamples 1 -ComputerName $DeviceName -ErrorAction SilentlyContinue | 
        Select-Object -ExpandProperty CounterSamples).CookedValue
        [math]::Round($counter,2) | Out-UDMonitorData 
    catch { 
        0 | Out-UDMonitorData 

Hello @psott,

Still the same, works once out of 10 and rest of the time the dashboard simply crash and powershell close.

thx for you help btw :slight_smile:

Edit: @psott & @adam : As soon as I add 2 UDMonitor, it crashed, if there is only one on the page, it’s ok. does it ring a bell ?

how do you run UD?
maybe more info can help us.
ud version
ps version
.net version

i am on ud version 2.7.0 and ps 5.1 and have more than one monitor on one page working

UD is started from a powershell command prompt
PSVersion 5.1.14393.3053
UD Version 2.6.0 Community
.Net Version 4.7.03062
Browser Chrome

I can’t imagine why PowerShell would crash because of UD like that. I’m surprised there aren’t any event viewer logs. If it was an app crash windows would create them It could be the application exiting for some reason but this is the first I’ve heard of this.

Does it matter what PowerShell cmdlets you are calling in your monitor or is it just whenever you add another monitor it crashes?

whatever I call in the monitor, as long as there are more than one, the whole thing crashes, I can’t figure out why this is happening, and honestly I can’t find any error in event viewer or anywhere else on the server running the dashboard, it’s obviously pretty weird.

Do you have a full dashboard you could share the reproduces this issue? I’d like to try it locally. There must be something I’m missing. I can add multiple monitors without issue.