What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Historic data using the API

Votes:

0

Your Vote:

Up

Down

I am trying to pull data using this string

https://jada/api/historicdata.xml?id=2325&avg=86400&sdate=2011-04-12-00-00-00&edate=2011-04-12-23-59-00

and I get this

  <?xml version="1.0" encoding="UTF-8" ?> 
- <histdata>
  <prtg-version>8.3.0.2022</prtg-version> 
- <item>
  <datetime>4/11/2011 12:00:00 AM</datetime> 
  <datetime_raw>40645.1666666667</datetime_raw> 
  <coverage>0 %</coverage> 
  <coverage_raw>0000000000</coverage_raw> 
  </item>
  </histdata>

Which does note match up if I use the web interface

  <?xml version="1.0" encoding="UTF-8" ?> 
- <histdata>
  <prtg-version>8.3.0.2022</prtg-version> 
- <item>
  <datetime>04/12/2011</datetime> 
  <datetime_raw>40646.1666666667</datetime_raw> 
  <value>9,993,296 KByte</value> 
  <value_raw>10233135437.0000</value_raw> 
  <value>948 kbit/s</value> 
  <value_raw>118448.4996</value_raw> 
  <value>3,398,224 KByte</value> 
  <value_raw>3479781826.0000</value_raw> 
  <value>322 kbit/s</value> 
  <value_raw>40278.4600</value_raw> 
  <value>6,595,072 KByte</value> 
  <value_raw>6753353611.0000</value_raw> 
  <value>625 kbit/s</value> 
  <value_raw>78170.0396</value_raw> 
  <value>0 %</value> 
  <value_raw>0.0000</value_raw> 
  <coverage>100 %</coverage> 
  <coverage_raw>0000009999</coverage_raw> 
  </item>
  </histdata>

Looked at the API documents and I am not sure what the problem is.

api prtg snmp

Created on Apr 14, 2011 2:17:49 PM by  mhowell (0) 1

Last change on Apr 18, 2011 3:18:13 PM by  Daniel Zobel [Product Manager]



5 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

which URL is used when you "produce" the historic data with the Webinterface? There should be a difference.

best regards.

Created on Apr 14, 2011 2:42:35 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

From the menu sensors -> View historical data. I expect that these should produce the same data set. My objective is to get the xml of the device for the day specified.

Thanks

Created on Apr 14, 2011 3:05:33 PM by  mhowell (0) 1



Votes:

0

Your Vote:

Up

Down

Do you get the same data when using a smaller average (1 hour) for example?

Created on Apr 15, 2011 3:28:26 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

When I use a smaller range the data is as expected. The output matches. If I offset the the start date by 1 hour and the end date by 1 hour I get the data that is close to what I expect.

https://jada/api/historicdata.xml?id=2325&avg=86400&sdate=2011-04-12-01-00-00&edate=2011-04-13-00-00-00-00

Using the web page I get 100% of the data compared to using the url which gives me 96% of the data.

Created on Apr 15, 2011 5:44:11 PM by  mhowell (0) 1



Votes:

0

Your Vote:

Up

Down

Please make sure you use the right time notation. To include an entire day (until midnight) into the query, please use 24-00-00 as hour definition in your date range.

For example, try

https://jada/api/historicdata.xml?id=2325&avg=86400&sdate=2011-04-12-01-00-00&edate=2011-04-13-00-24-00-00

This will result in exactly the same XML files, no matter if queried via web interface (Historic Data tab) or the API functions.

Created on Apr 19, 2011 3:36:12 PM by  Daniel Zobel [Product Manager]

Last change on Apr 19, 2011 3:36:27 PM by  Daniel Zobel [Product Manager]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.