Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class getPRTG{
- var $baseURL = 'https://yourprtgdomain.com/api';
- var $authString = '&username=username&password=password$';
- public function getDownSensors(){
- $options = '/table.json?content=sensors&output=json&columns=objid&filter_status=5';
- $url = $this->baseURL . $options . $this->authString;
- $json = file_get_contents($url);
- $obj = json_decode($json);
- return $obj->sensors;
- }
- public function getSensor($id){
- $options = '/getsensordetails.json?id=' . $id;
- $url = $this->baseURL . $options . $this->authString;
- $json = file_get_contents($url);
- $obj = json_decode($json);
- return $obj;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement