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


Article Comments

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.


Sep, 2016 - Permalink

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.


Sep, 2016 - Permalink

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.


Sep, 2016 - Permalink

Awesome help Mark and Arne, very much appreciated.


Sep, 2016 - Permalink