Get-SensorHistory > Input string was not in a correct format
See original GitHub issueMy 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:
PS C:\Users\user> Get-Sensor -id 81053 | Get-SensorHistory -end $enddate -start $startdate
DateTime SensorId MMA-Option:CUST-ALERT(#) Coverage(%)
-------- -------- ------------------------ -----------
28.05.2021 08:24:26 81053 644 100
28.05.2021 07:24:01 81053 644 100
28.05.2021 03:24:01 81053 644 100
[...]
PS C:\Users\user> Get-Sensor -id 81082 | Get-SensorHistory -end $enddate -start $startdate
Get-SensorHistory : Input string was not in a correct format.
At line:1 char:24
+ ... -Sensor -id 81082 | Get-SensorHistory -end $enddate -start $startdate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SensorHistory], FormatException
+ FullyQualifiedErrorId : System.FormatException,PrtgAPI.PowerShell.Cmdlets.GetSensorHistory
With an average argument, I can get a return value. But I want the raw data, no average.
PS C:\Users\user> Get-Sensor -id 81082 | Get-SensorHistory -end $enddate -start $startdate -average 300
DateTime SensorId MMA-Option:CRW(#) Downtime(%) Coverage(%)
-------- -------- ----------------- ----------- -----------
28.05.2021 09:20:00 81082 0 0
28.05.2021 09:15:00 81082 0 0
28.05.2021 09:10:00 81082 0 0
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
- It wasn’t covered by the wiki, I swear!
- I have tried doing some basic research on this issue but haven’t been able to come up with anything. Please help!
Issue Analytics
- State:
- Created 2 years ago
- Comments:30 (17 by maintainers)
Top GitHub Comments
Yeah that’s exactly right, and now I realise why PRTG wasn’t handling the time well. I’ll go and fix my sensor 😃 Hopefully I can do that without screwing up the existing data.
Hi @LumKitty,
Please be advised this is now being tracked in #241; please subscribe to that issue for further updates as to when this issue is resolved