-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-SensorHistory > Input string was not in a correct format #221
Comments
Hi @schoenm1, I don't think the sensor scanning interval is related to this issue; it appears that some historical info on this sensor is in some sort of format that Can you please do Set-PrtgClient -LogLevel Response
Get-Sensor -id 81082 | Get-SensorHistory -end $enddate -start $startdate -Verbose And provide the XML response? Also, when you get the exception what is the output of |
|
Thanks @schoenm1, In addition, after you generate the exception can you provide the output of |
|
Hi @schoenm1, To give some context before getting into the issue
Now that we understand how <item>
<datetime>28.05.2021 08:48:46</datetime>
<datetime_raw>44344.2838735764</datetime_raw>
<value channel="MMA-Option:CRW" channelid="2">8'544 #</value>
<value_raw channel="MMA-Option:CRW" channelid="2">8544.0000</value_raw>
<coverage>100 %</coverage>
<coverage_raw>0000010000</coverage_raw>
</item> In this XML, we have a channel MMA-Option:CRW whose raw value was Are you able to install PrtgAPI on your PRTG Core Server (if it isn't already), run the following commands below on your PRTG Core Server the output? Get-PrtgClient -Diagnostic
(get-culture).numberformat Regards, |
Hi @lordmilko |
Hi @schoenm1, No worries; in that case, simply running the following on the core server should suffice: get-culture
(get-culture).numberformat |
Server 1 (Issue)
Server 2 (no Issue)
|
Hi @schoenm1, Are you also able to include the output of |
Server 1 (Issue)
Server 2 (no Issue)
|
Thanks @schoenm1, I see that the issue is in fact that the Given this, I think I will need to audit all possible cultures that one could have and ensure PrtgAPI can handle their numbers properly. In the meantime, a potential workaround could be to potentially set server 1 to use the en-US culture as well (simply change the region in Control Panel and restart PRTG) Regards, |
Hi @lordmilko |
…lues with theoretically any single character thousands/decimal group separator combination (#221)
Hi @schoenm1, Just following up on this; are you able to advise whether the latest build resolved the issue? |
Hi @lordmilko |
Hi @schoenm1, Please be advised PrtgAPI 0.9.16 has now been released. To update PrtgAPI, please run Regards, |
I have this issue in 0.9.16
Sample XML from this sensor:
|
Hi @LumKitty, Can you please try with the latest pre-release version and advise if this issue is still happening? Please see the manual installation instructions for more info on running this pre-release version If it still does not work in the latest pre-release version, please provide the output of |
Same issue using the version downloaded from that link. However that version also reports itself as 0.9.16 so I could just be being a derp and running the wrong version. I can't find another version anywhere, apart from earlier releases
|
Hi @LumKitty, If you're using the pre-release version it should look like this PSVersion : 5.1.14393.4583
PSEdition : Desktop
OS : Microsoft Windows Server 2016 Standard
PrtgAPIVersion : 0.9.17-preview.5
Culture : en-US
CLRVersion : .NET Framework 4.8 (528049)
PrtgVersion : 21.2.67.1562
PrtgLanguage : english.lng If you
It should hopefully show the right version, in which case are you able to see if the issue still occurs there? There was an issue in #223 in June that I fixed in this pre-release version, so this may be that same issue. |
Aha, I was being a derp, in my script I needed to import the .psd1 not the .psm1 to get 0.9.17-preview.5 Unfortunately, still the same issue
|
Thanks @LumKitty, It sounds like this is a new bug. Based on the exception message you're getting Get-SensorHistory : Don't know how to convert double value '1.4444' (86.661). I expect there should be an entry in the XML output that contains the numbers 1.4444 and 86.661. Are you able to provide the XML output containing these values? As I think you've already surmised, you can get this XML output by doing Set-PrtgClient -LogLevel All
Get-Sensor -Id $PRTGSensorID | Get-SensorHistory -EndDate $StartDate -StartDate $EndDate -Verbose |
It's erroring in a different place today, may just be due to new data but here we are..
|
Thanks @LumKitty, I see what the issue is; in the meantime, depending on your use case you may be able to work around this by doing |
Hi @LumKitty, Are you able to advise what sort of sensor this is? Is this a built-in sensor in PRTG, or is this a custom channel you've written yourself? If it's the latter, are you able to provide the XML used to define the 02_DISKNAME - TimeLag channel? Regards, |
It's EXEXML, I'm producing it like this:
|
Thanks @LumKitty, I think I have the complete picture of what is going on here; are you able to check the settings of the I believe the reason the issue is occurring is that because the EXEXML sensor was configuring with an illegal
PrtgAPI knows how to convert the value of a channel to a Regards, |
Yeah that's exactly right, and now I realise why PRTG wasn't handling the time well. I'll go and fix my sensor :) |
My enviroment: I have some EXEXML Sensors. These Sensors are reporting a number and the execution time of most .ps1 files are <60 Seconds. But one Sensor execution time is between 60-120 seconds. (I think this could be the issue)
For every sensor, the "Get-SensorHistory" is working, except for the exe Sensor (long execution time).
For this sensor to work, I needed to increase the Timeout (sec) from the default value of 60 seconds.
All other Sensors:
With an average argument, I can get a return value. But I want the raw data, no average.
Is there a possiblity to wait longer for a reply?
I think the exection time could be the problem but I don't understand, why a "Get-SEnsorHistory" should be related to the Sensor execution time. But all other parameters are the same as the other working sensors.
Due Dilligance
Please enter an 'x' between the brackets to indicate you have done these
The text was updated successfully, but these errors were encountered: