What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

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

Collecting alerts/state change history via API

Votes:

0

Hi,

Is it possible to collect state change (alert) information for our sensors WITH historical data (past changes) and in bulk (all sensors in one call or at least in large groups) via the PRTG API?

So far I have been sifting through the documentation and I haven't found a way to achieve that, but I am hoping that I may have missed something or the necessary option exists but is not documented.

Thanks, Alex

alerts api prtg

Created on Jul 5, 2017 11:48:53 AM



1 Reply

Accepted Answer

Votes:

0

Dear Alex

Using the API, only one sensor per call can be queried. To get the data of multiple sensors, please write a script which in the first steps reads the object ID of all sensors from a particular device tree branch, and then iterates over those IDs.

An example call is

/api/table.xml?id=40&content=sensors&columns=objid,name&count=*

This call will provide all sensors under the local probe device (which has the id=40.)

Alert information is not part of the historic data and cannot be extracted in the same way. You can use an API call and filter for up and down messages:

api/table.csv?id=2123&content=messages&filter_status=620&filter_status=608&filter_status=607&count=*&columns=objid,datetime,parent,type,name,status,message

This example is for a sensor with the id=2123.

Created on Jul 6, 2017 4:19:12 PM by  Arne Seifert [Paessler Support]




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.