What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Need to automatically export specific sensor data (csv,xml)

Votes:

0

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

csvexport http-api prtg-network-monitor

Created on May 8, 2020 9:19:42 AM



11 Replies

Votes:

0

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

Created on May 8, 2020 1:51:40 PM by  Matthias Kupfer [Paessler Support]

Last change on May 8, 2020 1:58:34 PM by  Matthias Kupfer [Paessler Support]



Votes:

0

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

Created on May 11, 2020 6:52:56 AM



Votes:

0

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

Created on May 11, 2020 9:34:58 AM by  Felix Saure [Paessler Support]

Last change on May 11, 2020 11:24:33 AM by  Felix Saure [Paessler Support]



Votes:

0

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

Created on May 11, 2020 12:09:34 PM



Votes:

0

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

Created on May 12, 2020 4:04:15 AM by  Felix Saure [Paessler Support]



Votes:

0

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

Created on May 12, 2020 10:36:19 AM



Votes:

0

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

Created on May 13, 2020 7:37:04 AM by  Felix Saure [Paessler Support]



Votes:

0

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

Created on May 13, 2020 9:08:27 AM



Votes:

0

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

Created on May 15, 2020 4:33:38 AM by  Felix Saure [Paessler Support]



Votes:

0

hello,

ID 2853 is a device group ID.

regards

Created on May 15, 2020 6:35:57 AM



Votes:

0

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

Created on May 15, 2020 12:40:05 PM by  Felix Saure [Paessler Support]




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.