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


API single call returning multi sensor channels

Votes:

0

Your Vote:

Up

Down

Good evening everyone,

I need to retrieve a large amount of sensors (and their channels) with one API request and return the whole list in JSON or XML. Unfortunately I can't seem to get any further than either having all the sensors values without the channel data, or the channel data but then it is only for a single sensor.

It is not feasible due to the total amount of sensors to perform a API call for each one of them because that would take too long (and create an asynchronous mess)

How can this be done ... and please don't tell me it cant :-)

Thanks Michaël

api channels multiple sensors

Created on Oct 6, 2018 7:30:26 PM by  Michaël De Coninck (0) 1



3 Replies

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hello Michaël,
thank you for your KB-Post/Inquiry.

Unfortunately I don't really have good news. Most API calls will only contain the value of a sensor's primary channel.

If you need all channels, you need to work with /api/table.xml?content=channels, in which case a sensor ID must be specified/supplied (for instance: &id=1234)

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Oct 8, 2018 11:30:46 AM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Luciano,

Unfortunately then in this case I would have to iterate through all sensors with individual /api/table.xml?content=channels&id=n requests which is not workable due to the delay it would create in rendering the data.

What is the structure of the data files you use (as you don't us any rdbms for this purpose), then I can maybe write my own api extension.

Thanks
Michaël

Created on Oct 8, 2018 12:47:45 PM by  Michaël De Coninck (0) 1

Last change on Oct 9, 2018 6:19:09 AM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello Michaël,
thank you for your reply.

Would you mind elaborating about what exactly you're trying to achieve? Why exactly do you want to get all live sensor data out of PRTG? What do you want to do with it?

But yes, I agree that iterating trough every possible sensor in your installation o get the live data for each channel from every sensor could take a while.

Depending on what you're trying to achieve, the following may save you some work:

However, direct access to the data files is not an option, they are binary-encoded in a proprietary format. The API is the only available interface with the data.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Oct 9, 2018 6:32:24 AM by  Luciano Lingnau [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.