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

Extract "Auto Acknowledge" setting from all sensors via API

Votes:

1

Hi,

When we have a sensor that is bouncing up and down we change the "auto Acknowledge" setting to "Show Down Acknowledged". Once the issue has been resolved we change this setting back to "Show down status on error. Unfortunately over time this second step isnt always done.

Therefore, I would like to query all sensors to see what the auto acknowledge setting is on them all.

Is there any way I can do this via the API?

Is there any way I can extract this data from the back end database?

Cheers, Phil

api auto-acknowledge prtg

Created on Sep 2, 2016 10:13:20 AM



Best Answer

Accepted Answer

Votes:

0

Here's a modification of my earlier referenced Powershell script that does what you want for ping sensors: https://gist.github.com/markwragg/02a91560f46210cf67ca5c810681f6ae

It seems to work when tested against my environment, you get a CSV result of sensor details and the value of the AutoAck setting as an additional column, but you could change the script to do whatever you need with the object output.

Created on Sep 2, 2016 1:14:48 PM



4 Replies

Votes:

0

I just wrote a Powershell script for auditing the URL settings of Transaction sensors via the API using Powershell. The trickiest part was working out the name of the property I wanted to audit, as the API documentation doesn't list these explicitly anywhere but they should be the same as or similar to what ever the setting is named.

To see how my script works see here: http://wragg.io/get-transaction-sensor-url-settings-from-prtg-with-powershell/

I'll do a little experimenting to see if I can work out the property name you need for you.

Created on Sep 2, 2016 1:00:31 PM



Votes:

0

Dear Phil

You can read out the auto-acknowledge setting for a sensor. Lets say the sensor ID is 2002, the according API call looks like

api/getobjectproperty.htm?id=2002&name=autoacknowledge

The result always inludes the PRTG version, and the value (here: 0 = off, 1 = on.)

To get a list of the IDs of all ping sensors, use

/api/table.csv?id=0&content=sensors&columns=objid,name&count=*&filter_type=ping

To get an XML instead, which is easier to use in powershell, replace table.csv with table.xml.

Created on Sep 2, 2016 1:11:41 PM by  Arne Seifert [Paessler Support]



Accepted Answer

Votes:

0

Here's a modification of my earlier referenced Powershell script that does what you want for ping sensors: https://gist.github.com/markwragg/02a91560f46210cf67ca5c810681f6ae

It seems to work when tested against my environment, you get a CSV result of sensor details and the value of the AutoAck setting as an additional column, but you could change the script to do whatever you need with the object output.

Created on Sep 2, 2016 1:14:48 PM



Votes:

0

Awesome help Mark and Arne, very much appreciated.

Created on Sep 6, 2016 12:30:13 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.