PRTG Manual: Live Data

You can access live data and live status data of objects using the PRTG API.

In this section:

PRTG System Status

You can get the PRTG system status such as the number of alarms or messages using the following API calls.

i_speechExamples

Live system status in the Extensible Markup Language (XML) format:

/api/getstatus.xml?id=0

Live system status in the JavaScript Object Notation (JSON) format:

/api/getstatus.htm?id=0

All sensors in use in the JSON format:

/api/sensortypesinuse.json

Number of all sensor states:

/api/gettreenodestats.xml

PRTG Health Status

You can get the overall PRTG system health status such as probe connection status and if login is possible using the following API calls:

i_speechExamples

Live overall system status of PRTG:

/api/healthstatus.json

Live overall system status of PRTG Hosted Monitor:

/api/healthstatus.json&mode=hosted

i_round_blueThe healthstatus API call only returns status codes; it does not return a JSON body. If the PRTG core server is up and the local probe is connected, the API call returns the 200 status. If these conditions are not met, the API call returns the 503 status.

PRTG Health Data

You can get the PRTG health data such as system CPU used (%), system memory used (%), disk space used (%), disk space used (GB), health (%), total number of probes, disconnected probes, total sensors, and sensor in the Unknown status using the following API calls:

i_speechExample

Live health data of PRTG in the JSON format using maxage:

/api/health.json&maxage=age

i_round_bluemaxage is the age in seconds for data to be considered "old". For example, if data is older than 4 minutes and maxage=120, the data will be refreshed and then sent to the client.

Live health data of PRTG in the JSON format using refreshnow:

/api/health.json&refreshnow=1/anything_else

i_round_blueIf refreshnow=1, the data will be refreshed before the API call is returned. Also, if refreshnow=1 is present in the API call, maxage will not be considered.

More

i_square_blueKNOWLEDGE BASE

How can I use the PRTG Application Programming Interface (API)?