Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


Pull values from Passler PRTG with PHP

function getJSON($id, $sid=0) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYSTATUS,false);
    curl_setopt($ch, CURLOPT_VERBOSE, false);
    $response = curl_exec($ch);
    $sensor=json_decode($response, true);

    if($sid!==false) {
    return $sensor;

Set $server to the url of your PRTG Server, set $user to a valid username, and $pass to a valid password. To use this function simply select the device ID, and the sensor number as an integer, to get all the sensors in the device simply set the second parameter to false.

e.g If you know your device is 1234 then call


This will return each sensor on that device. When you know what number you want simply use that as the second parameter to select only that sensor for the device. Generally, they are numbered in the order they appear on the PRTG web interface, so that 0 is the first sensor for a device, 1 is the second and so on.


Fetches the second sensor on the device 1234.

/data/webs/external/dokuwiki/data/pages/php/access_passler_prtg_using_php_and_retrieve_sensor_data.txt · Last modified: 2023/01/31 11:48 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki