Closed cyberoner1 closed 2 years ago
Hi @cyberoner1,
After reproducing the error can you please provide the output of $error[0].Exception.StackTrace
sorry for the late reply.. here is the output:
$error[0].Exception.StackTrace
at System.String.Substring(Int32 startIndex, Int32 length)
at PrtgAPI.Utilities.ConvertUtilities.TryRoundDecimal(String str, Double raw, Func2 toDecimal, String numDecStr, String strDecStr, Double& result) at PrtgAPI.Utilities.ConvertUtilities.ToDynamicDouble(String str, Nullable
1 raw)
at PrtgAPI.PowerShell.SensorHistoryFormatter.GetChannelValue(ChannelHistoryRecord channel)
at PrtgAPI.PowerShell.SensorHistoryFormatter.CreateObject(SensorHistoryRecord date)
at PrtgAPI.PowerShell.SensorHistoryFormatter.
Thanks @cyberoner1,
Can you also do the following:
First do
Set-PrtgClient -LogLevel Response
then invite Get-SensorHistory
again, specifying the -Verbose
parameter
get-sensor -tag tableau -type snmptraffic,snmpdiskfree,snmpcpu,ping -status up -ErrorAction SilentlyContinue |get-sensorhistory -Enddate $Enddate -Startdate $Startdate -Verbose
assuming it still crashes can you please provide a copy of the response that is emitted
Hi @cyberoner1,
Just following up on this, are you able to advise?
Hi @lordmilko, I've actually had this same issue for a long time and just happened to see this open issue now. It happens on maybe 3 or 4 sensors out of around 300, with which ones fail changing week to week (I guess as underlying data changes). I've attached all the same output requested with a failing sensor. Hopefully this helps.
Commands: $current_date = Get-Date $sensor = Get-Sensor -Id 60010 $sensor | Get-SensorHistory -StartDate $current_date -EndDate $current_date.AddDays(-2) -Average 3600 -Verbose
Hi @squintfox,
Thanks for providing these logs. I have pushed a commit which I believe should contain a fix for this issue. Are you able to test PrtgAPI 0.9.18-preview.5 by following the manual installation instructions and advise whether the issue is now resolved?
@lordmilko it looks like it's working great. Thank you.
Describe the bug
When running the script I am getting the error somewhere in the middle,
any Idea why=
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?
Additional context
No response