Hi

Hi need to export sensors data of a Specific Sensor "Group Name"(id=2853) with the following colums:

group,device,host,status

possibly colums separated by comma withouth the raw coulums.

Here is what actually i get:

query used: https://servername/api/table.csv?content=sensors&output=csvtable&columns=Group,device,status,filter_type=ping&id=2853

result "Group","Group(RAW)","Device","Device(RAW)","Host","Host(RAW)","Status","Status(RAW)","","(RAW)" "Ris-118","Ris-118","Colimatic-B-Node","Colimatic-B-Node","172.25.13.29","172.25.13.29","Up","3","Not found",""

what I need: Group,Device,Host,Status Ris-118,Colimatic-B-Node,172.25.13.29,Up

Can Somebody help me with the query?

Thanks for support


Article Comments

Dear Angelo,

please add the parameter "&noraw=1" to exclude the "raw" colums from the results. This parameter does not work for all API calls, but can be used for this one.

Please note, that you have a typo in your query. It should read (note the "&" instead of the comma, before "filter_type"): https://servername/api/table.csv?content=sensors&output=csvtable&columns=Group,device,status&filter_type=ping&id=2853

The full query would be: https://servername/api/table.csv?content=sensors&output=csvtable&columns=Group,device,status&filter_type=ping&id=2853&noraw=1


Kind Regards,
Matthias Kupfer - Team Tech Support


May, 2020 - Permalink

Thanks Matthias for the reply.

Now with the "&noraw=1" raw column is excluded but the column "host" become empty...

here's the custom query:

https://servername/api/table.csv?content=sensors&output=csvtable&columns=Group,host,device,status&filter_type=ping&id=2853&noraw=1

here the output(host missing):

Group,"Host","Device","Status" Ris-118,"","Colimatic-B-Node","Up" Ris-118,"","Colimatic-Router","Up"

Am I missing something? Thanks for support


May, 2020 - Permalink

Hi Angelo,

Update: I need to correct myself here. The "host" parameter indeed just works for devices, and not for sensors. It's therefore working as intended.


Kind regards,
Felix Saure, Tech Support Team


May, 2020 - Permalink

Thanks Felix for the reply.

Host parameters appear in my csv if I include the RAW colums ..

Is there a way to insert in my list the IP address of the sensors without including raw colums?

here is my query: https://servername/api/table.csv?content=sensors&output=csvtable&columns=Group,host,device,status&filter_type=ping&id=2853&noraw=1

thanks


May, 2020 - Permalink

Dear Angelo,

I'm afraid it's not. As you are interested in more granular API calls, you might want to check if it's possible with this PowerShell module: https://github.com/lordmilko/PrtgAPI


Kind regards,
Felix Saure, Tech Support Team


May, 2020 - Permalink

Thanks Felix for the support.

I move the noraw=1 option at the end ofthe url and the data now are perfect:

https://servername/api/table.csv?content=devices&output=csvtable&columns=group,device,host,status,filter_type=ping&id=2853&username=xxxx&passhash=1980399249&noraw=1

If possible I need to add to my query the time (date+hour) of the status "up" and "down", is there a way to do it? Just to understand when the down and up has been triggered

thanks


May, 2020 - Permalink

Dear Angelo,

Just what is documented on the "Setup > PRTG API > Live Data" documentation.

For historic log entries, this query can be used:

/api/table.xml?content=messages&columns=objid,datetime,parent,type,name,status,message

But only for "messages", not with the filter for devices.


Kind regards,
Felix Saure, Tech Support Team


May, 2020 - Permalink

Thanks for the reply.

According the live data guide for multiple objects: https://www.paessler.com/manuals/prtg/live_multiple_object_property_status

if i well understand the parameter needed is "Uptimesince" and "downtimesince" Description: Cumulated downtime/uptime of the sensor (in minutes/hours)

but when I put the parameter in my API query the column "Uptimesince" is empty: https://servername/api/table.csv?content=devices&output=csvtable&columns=group,device,host,status,uptimesince,filter_type=ping&id=2853&username=xxx&passhash=1980399249&noraw=1

Do u have any tips? Thanks for support


May, 2020 - Permalink

Hello Angelo,

What's behind the ID 2853? This needs to be a probe or group to work.


Kind regards,
Felix Saure, Tech Support Team


May, 2020 - Permalink

hello,

ID 2853 is a device group ID.

regards


May, 2020 - Permalink

Angelo,

Having another look at your query the "Filter_type" is not separated with "&". Please ensure that you follow all descriptions on the "Setup > PRTG API" page, we cannot provide extended support for typos here I'm afraid.


Kind regards,
Felix Saure, Tech Support Team


May, 2020 - Permalink