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

API custom page request

Votes:

0

Hi, I need to generate a web page that will give me a table with all of the down sensors with this columns - device name, sensor name .

I'm not very good with the API. can you help me?

Thanks, Meir

alarm api device sensor

Created on Sep 5, 2011 11:12:12 AM



Best Answer

Accepted Answer

Votes:

0

This can be done with API call:

/api/table.xml?content=sensors&output=html&columns=device,sensor&filter_status=5&filter_status=13&filter_status=14&login=myusername&password=mypassword

Replace myusername and mypassword with valid credentials to connect to your PRTG server.

Only, for some strange reason it produces a .xml file that has to be manually renamed to .htm before it can be opened with your web browser.

Created on Sep 6, 2011 10:58:03 AM



12 Replies

Votes:

0

Hello,

the query would be something like:

https://MY_PRTG/api/table.xml?content=sensors&filter_status=5&output=xml&columns=device,sensor

best regards.

Created on Sep 5, 2011 2:31:06 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Thanks! Can I take this xml and produce http with a table? ( just like when I press the alarms button on the PRTG web interface)

Meir

Created on Sep 5, 2011 2:52:55 PM



Votes:

0

If you want a table, you could use the alarms-URL directly:

https://MY_PRTG/alarms.htm?filter_status=5&filter_status=13&filter_status=14

best regards.

Created on Sep 5, 2011 2:55:59 PM by  Torsten Lindner [Paessler Support]



Votes:

0

yes, but i don't need all of the columns... only device name, and sensor name of the "down state" devices.

Meir

Created on Sep 5, 2011 2:58:05 PM



Votes:

0

The HTML-Table is only available in this format. You could however copy the alarms.htm and name it alarms2.htm, remove all the unwanted columns and then use the above mentioned URL again

https://MY_PRTG/alarms2.htm?filter_status=5&filter_status=13&filter_status=14

Created on Sep 5, 2011 3:09:38 PM by  Torsten Lindner [Paessler Support]



Accepted Answer

Votes:

0

This can be done with API call:

/api/table.xml?content=sensors&output=html&columns=device,sensor&filter_status=5&filter_status=13&filter_status=14&login=myusername&password=mypassword

Replace myusername and mypassword with valid credentials to connect to your PRTG server.

Only, for some strange reason it produces a .xml file that has to be manually renamed to .htm before it can be opened with your web browser.

Created on Sep 6, 2011 10:58:03 AM



Votes:

0

Thanks! Exactly what I was looking for. Anyone have idea how to produce htm page instead of the xml file? that will solve the problem completely...

Created on Sep 6, 2011 12:31:44 PM



Votes:

0

Hi Meirely,

To solve the problem completely, you could write a script or batch file that:

  1. Downloads the file from the url
  2. Renames the file to .htm
  3. Starts a browser session with the renamed file

Created on Sep 6, 2011 12:58:46 PM



Votes:

0

Hi Meirely

This is even a better solution.

In the \website\api folder of your PRTG installation create a new file named table.htm and paste the folowing code:

<#table output="htm" count="500" refreshable="false" sortable="false" tools="" showzoomlink="" tabletitle="" links="false" infoheader="false">

In your web browser you can now use the following url:

/api/table.htm?content=sensors&output=html&columns=device,sensor&filter_status=5&filter_status=13&filter_status=14&login=myusername&password=mypassword

Replace myusername and mypassword with valid credentials to connect to your PRTG server.

This will open the html page with the data you are looking for directly in your browser.

Created on Sep 6, 2011 5:16:56 PM



Votes:

0

That is working great! Is there a parameter that I can add in the htm to make the page auto refresh?

Tha

Created on Sep 7, 2011 6:25:56 AM



Votes:

0

In the table.htm file Insert the folowing code above the existing code to make the page refresh every 15 seconds

<META HTTP-EQUIV="refresh" CONTENT="15">

Created on Sep 7, 2011 12:46:17 PM



Votes:

0

working! thanks

Created on Sep 7, 2011 2:09:27 PM




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.