Skip to content
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 sometimes returns a decimal value #125

Closed
robm82 opened this issue Dec 17, 2019 · 7 comments
Closed

Get-SensorHistory sometimes returns a decimal value #125

robm82 opened this issue Dec 17, 2019 · 7 comments
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version

Comments

@robm82
Copy link

robm82 commented Dec 17, 2019

Describe the bug
When attempting to run the below command:

Get-SensorHistory -Id 18955 -StartDate (Get-Date) -EndDate (Get-Date).AddDays(-30) -Average 86400

The free bytes return value can sometimes produce a decimal value, which can be seen on the data return for the 17/12 and 12/12:

DateTime            SensorId FreeSpace(%) FreeBytes(MByte) Total(MByte) Downtime(%) Coverage(%)
--------            -------- ------------ ---------------- ------------ ----------- -----------
17/12/2019 00:00:00 18955    70           42.778           60911        0           100
16/12/2019 00:00:00 18955    70           42787            60911        0           100
15/12/2019 00:00:00 18955    70           42856            60911        0           100
14/12/2019 00:00:00 18955    70           42881            60911        0           100
13/12/2019 00:00:00 18955    70           42887            60911        0           100
12/12/2019 00:00:00 18955    70           42.889           60911        0           100
11/12/2019 00:00:00 18955    70           42883            60911        0           100
10/12/2019 00:00:00 18955    70           42843            60911        0           100
09/12/2019 00:00:00 18955    70           42825            60911        0           100
08/12/2019 00:00:00 18955    70           42810            60911        0           100
07/12/2019 00:00:00 18955    70           42822            60911        0           100
06/12/2019 00:00:00 18955    70           42823            60911        0           100
05/12/2019 00:00:00 18955    70           42837            60911        0           100
04/12/2019 00:00:00 18955    70           42844            60911        0           100
03/12/2019 00:00:00 18955    70           42864            60911        0           100
02/12/2019 00:00:00 18955    70           42857            60911        0           100
01/12/2019 00:00:00 18955    70           42872            60911        0           100
30/11/2019 00:00:00 18955    70           42879            60911        0           100
29/11/2019 00:00:00 18955    70           42871            60911        0           100
28/11/2019 00:00:00 18955    70           42882            60911        0           100
27/11/2019 00:00:00 18955    70           42899            60911        0           100
26/11/2019 00:00:00 18955    70           42819            60911        0           100
25/11/2019 00:00:00 18955    70           42791            60911        0           100
24/11/2019 00:00:00 18955    70           42781            60911        0           100
23/11/2019 00:00:00 18955    70           42795            60911        0           100
22/11/2019 00:00:00 18955    70           42798            60911        0           100
21/11/2019 00:00:00 18955    70           42809            60911        0           100
20/11/2019 00:00:00 18955    70           42825            60911        0           100
19/11/2019 00:00:00 18955    70           42825            60911        0           100
18/11/2019 00:00:00 18955    70           42846            60911        0           100

Steps to reproduce
Steps to reproduce are above. I have checked the PRTG Server using the web client, and the history data appears to be there in full so I cannot see any reason why it is showing some of the values as a decimal.

What is the output of Get-PrtgClient -Diagnostic?

Get-PrtgClient -Diagnostic                                                                        

PSVersion      : 5.1.18362.145
PSEdition      : Desktop
OS             : Microsoft Windows 10 Enterprise
PrtgAPIVersion : 0.9.12
Culture        : en-GB
CLRVersion     : .NET Framework 4.8 (528040)
PrtgVersion    : 19.4.54.1506
PrtgLanguage   : english.lng

Additional context
This may be a result of attempting to fix the other issues in the new 0.9.12 release

@robm82 robm82 added the alleged-bug Bugs raised by people helpfully using the Bug Report template! label Dec 17, 2019
@lordmilko
Copy link
Owner

Hi @robm82,

Can I get you to please run Set-PrtgClient -LogLevel Response, run this again and provide the XML of the records that had a decimal value? (the December 12th and 17th) and then for comparison also provide the XML for the 16th

@robm82
Copy link
Author

robm82 commented Dec 17, 2019

Hi @lordmilko,

I have run that, but for some reason, it isn't outputting any data for the 17th. Below is what I managed to get:

VERBOSE: Get-SensorHistory: <?xml version="1.0" encoding="UTF-8"?>                                                        <histdata totalcount="30" listend="0">                                                                                   <prtg-version>19.4.54.1506</prtg-version>                                                                              </histdata>                                                                                                           VERBOSE: Get-SensorHistory: <?xml version="1.0" encoding="UTF-8"?>
  <histdata totalcount="30" listend="1">
   <prtg-version>19.4.54.1506</prtg-version>
   <item>
    <datetime>16/12/2019</datetime>
    <datetime_raw>43816.0000000000</datetime_raw>
    <value channel="Free Space" channelid="0">70 %</value>
    <value_raw channel="Free Space" channelid="0">70.2311</value_raw>
    <value channel="Free Bytes" channelid="1">42,778 MByte</value>
    <value_raw channel="Free Bytes" channelid="1">44856456689.7778</value_raw>
    <value channel="Total" channelid="2">60,911 MByte</value>
    <value_raw channel="Total" channelid="2">63869808640.0000</value_raw>
    <value channel="Downtime" channelid="-4">0 %</value>
    <value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
    <coverage>100 %</coverage>
    <coverage_raw>0000010000</coverage_raw>
   </item>
   <item>
    <datetime>15/12/2019</datetime>
    <datetime_raw>43815.0000000000</datetime_raw>
    <value channel="Free Space" channelid="0">70 %</value>
    <value_raw channel="Free Space" channelid="0">70.2453</value_raw>
    <value channel="Free Bytes" channelid="1">42,787 MByte</value>
    <value_raw channel="Free Bytes" channelid="1">44865509504.0000</value_raw>
    <value channel="Total" channelid="2">60,911 MByte</value>
    <value_raw channel="Total" channelid="2">63869808640.0000</value_raw>
    <value channel="Downtime" channelid="-4">0 %</value>
    <value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
    <coverage>100 %</coverage>
    <coverage_raw>0000010000</coverage_raw>
   </item>
   <item>
    <datetime>14/12/2019</datetime>
    <datetime_raw>43814.0000000000</datetime_raw>
    <value channel="Free Space" channelid="0">70 %</value>
    <value_raw channel="Free Space" channelid="0">70.3579</value_raw>
    <value channel="Free Bytes" channelid="1">42,856 MByte</value>
    <value_raw channel="Free Bytes" channelid="1">44937460424.0287</value_raw>
    <value channel="Total" channelid="2">60,911 MByte</value>
    <value_raw channel="Total" channelid="2">63869808640.0000</value_raw>
    <value channel="Downtime" channelid="-4">0 %</value>
    <value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
    <coverage>100 %</coverage>
    <coverage_raw>0000010000</coverage_raw>
   </item>
   <item>
    <datetime>13/12/2019</datetime>
    <datetime_raw>43813.0000000000</datetime_raw>
    <value channel="Free Space" channelid="0">70 %</value>
    <value_raw channel="Free Space" channelid="0">70.4000</value_raw>
    <value channel="Free Bytes" channelid="1">42,881 MByte</value>
    <value_raw channel="Free Bytes" channelid="1">44964333795.5556</value_raw>
    <value channel="Total" channelid="2">60,911 MByte</value>
    <value_raw channel="Total" channelid="2">63869808640.0000</value_raw>
    <value channel="Downtime" channelid="-4">0 %</value>
    <value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
    <coverage>100 %</coverage>
    <coverage_raw>0000010000</coverage_raw>
   </item>
   <item>
    <datetime>12/12/2019</datetime>
    <datetime_raw>43812.0000000000</datetime_raw>
    <value channel="Free Space" channelid="0">70 %</value>
    <value_raw channel="Free Space" channelid="0">70.4094</value_raw>
    <value channel="Free Bytes" channelid="1">42,887 MByte</value>
    <value_raw channel="Free Bytes" channelid="1">44970348188.4444</value_raw>
    <value channel="Total" channelid="2">60,911 MByte</value>
    <value_raw channel="Total" channelid="2">63869808640.0000</value_raw>
    <value channel="Downtime" channelid="-4">0 %</value>
    <value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
    <coverage>100 %</coverage>
    <coverage_raw>0000010000</coverage_raw>
   </item>

@lordmilko
Copy link
Owner

lordmilko commented Dec 17, 2019

Did that result in the value 42.887 for 12/12/19 when you ran that?

@lordmilko
Copy link
Owner

lordmilko commented Dec 17, 2019

I think the datetime and datetime_raw are slightly different values; can you also provide the data for 11/12/19, and also provide the regular output from Get-SensorHistory?

Nevermind, I've managed to reproduce the issue, I know what's wrong here.

@lordmilko lordmilko added bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version and removed alleged-bug Bugs raised by people helpfully using the Bug Report template! labels Dec 17, 2019
@lordmilko
Copy link
Owner

Hi @robm82,

I have published a new release candidate that should have resolved this issue. Can you please give it a try and let me know how you go

Thanks for raising this issue

Regards,
lordmilko

@robm82
Copy link
Author

robm82 commented Dec 17, 2019

Hi @lordmilko,

I have just manually downloaded the latest version, and that looks to have resolved the issue.
Many thanks again for resolving this so quickly.

Regards,
robm82

@lordmilko
Copy link
Owner

Hi @robm82,

Please be advised PrtgAPI 0.9.12 has now been released, which includes the fix for this issue as well as other enhancements

If you wish to update your system PrtgAPI installation, simply run

Update-Module PrtgAPI

and reopen PowerShell

Regards,
lordmilko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version
Projects
None yet
Development

No branches or pull requests

2 participants