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

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How do I get a live channel value from PRTG's rest api?

Votes:

0

Your Vote:

Up

Down

I know I can get a sensors value via:

http://192.168.1.13/api/getsensordetails.json?id=2247&username=xxx&passhash=xxx

but I can't figure out how to get the channel values?

Any help would be great!

Thanks

api channel rest

Created on Jan 7, 2016 11:17:17 PM by  rossdargan (80) 1



5 Replies

Votes:

0

Your Vote:

Up

Down

Hi,

in order to get the channel data, use the following API call: http://192.168.1.13/api/table.json?content=channels&output=json&columns=name,lastvalue_&id=2247

The result will look like this:

{  
   "prtg-version":"15.4.21.5636",
   "treesize":0,
   "channels":[  
      {  
         "name":"Available Memory",
         "lastvalue":"8.325 MByte",
         "lastvalue_raw":87297228800.0000
      },
      {  
         "name":"Downtime",
         "lastvalue":""
      },
      {  
         "name":"Percent Available Memory",
         "lastvalue":"51 %",
         "lastvalue_raw":500.9934
      },
      {  
         "name":"Total Memory",
         "lastvalue":"16.326 MByte",
         "lastvalue_raw":171193139200.0000
      }
   ]
}

Created on Jan 8, 2016 10:17:53 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

That sort of worked, but I'm getting funny raw values:

{ prtg-version: "15.4.21.5215", treesize: 0, channels: [ { name: "Downtime", lastvalue: "" }, { name: "Humidity", lastvalue: "93.4 %", lastvalue_raw: 930.4 }, { name: "Light", lastvalue: "82 %", lastvalue_raw: 820 }, { name: "Reservoir", lastvalue: "Reservoir Level OK", lastvalue_raw: 1 }, { name: "Temperature", lastvalue: "5.6 °C", lastvalue_raw: 50.6 } ] }

Why is the temperature 5.6 getting a raw value of 50.6?

Created on Jan 8, 2016 2:22:49 PM by  rossdargan (80) 1



Votes:

0

Your Vote:

Up

Down

Not sure why, dividing them by 10 gets you the correct values anyway :)

Created on Jan 11, 2016 7:55:38 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Unfortunately it's not that simple. I need to do a string replace on "0." and replace it with ".". Dividing by 10 would make the units wrong by10.

Created on Jan 11, 2016 8:20:28 AM by  rossdargan (80) 1



Votes:

0

Your Vote:

Up

Down

Ah, you're right, but your solution should work fine :)

Created on Jan 11, 2016 8:36:56 AM by  Stephan Linke [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.