New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

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

 

Top Tags


View all Tags


Get last sensor values from PRTG API query

Votes:

0

Your Vote:

Up

Down

Hi all

Im trying to get some information by doing two querys to the "values" and "messages" tables. Im getting the last value sorting by -datetime and using count=1. The problem is that i'm just getting the values from ranges of the last 5 minutes and i want it the most real time possible. It's any chance to solve this or another query?

1st query: https://prtgserverurl/api/table.json?content=messages&columns=datetime,parent,group&sortby=-datetime&count=1&id=2477&usecaption=true

2nd query: https://prtgserverurl/api/table.json?content=values&columns=datetime,value_&sortby=-datetime&count=1&id=2477&usecaption=true

It's important to get the data the most clearly as possible, i mean, without "[3 min ago]" or things like that, and getting all the requested info as tags of the JSON file

Sorry for my bad english.

thanks!

api channel http-api prtg sensor

Created on Oct 4, 2018 4:10:09 PM by  jaguzmanb (0) 1



3 Replies

Votes:

0

Your Vote:

Up

Down

Hello jaguzmanb,

Thank you very much for your contact.

What's the configured scanning interval for the object #2477?
If the scanning interval is set to a considerably high interval, it will be not possible to gather anything close to real time, I'd assume.

Thank you very much in advance for your information.

Best regards,
Sebastian

Created on Oct 8, 2018 1:30:58 PM by  Sebastian Kniege [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello Sebastian,

The scanning interval is 1 minute. I hope to gather the info at least in that interval, not the 5 minutes im having.

Regards

Created on Oct 8, 2018 2:07:59 PM by  jaguzmanb (0) 1



Votes:

0

Your Vote:

Up

Down

Hello,

According to our API documentation this is the closest you can get. Please see 'Setup | PRTG API | Live Data' for further information.

Get details about a sensor in JSON:

/api/getsensordetails.json?id=sensorid

This will output the latest sensor results that match the information from the sensor's Overview tab.

Anyways, this leads to the fact that actual real time monitoring is not possible and the closest results are as old as the last sensor scan.

Best regards,
Sebastian

Created on Oct 9, 2018 10:21:23 AM by  Sebastian Kniege [Paessler Support]



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.