question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-SensorHistory > Input string was not in a correct format

See original GitHub issue

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:

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:closed
  • Created 2 years ago
  • Comments:30 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
LumKittycommented, Sep 15, 2021

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.

0reactions
lordmilkocommented, Sep 15, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Input string was not in a correct format
The error means that the string you're trying to parse an integer from doesn't actually contain a valid integer.
Read more >
Get-SensorHistory : Input string was not in a correct format. ...
Describe the bug Get-SensorHistory crashes upon recieving input from PRTG on some ids. This terminates the cmdlet even with ...
Read more >
Input String Was Not in a Correct Format: Working Solutions
Input string was not in a correct format error occurs when you convert non-numeric data into an int or exceed the limit of...
Read more >
How to resolve "Input string was not in the correct format" ...
I have a fieldname called caseNumber with Smallint data type in sql server database. When I use the following line in my c#...
Read more >
[Solved] C# system.formatexception: 'input string was not in ...
I am getting error c# system.FormatException: 'Input string was not in a correct format.' for the below code. I have tried several threads...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found