Hi, We have a scenario in our environment where I want to delete a sensor when its status changes to down. I know that deleting a sensor can be done through the API (I have used the API to auto-acknowledge certain sensors when they go down). I found the following information in the manual and have verified that it deletes a sensor when I replace the "objectid" with the ID of the sensor.

/api/deleteobject.htm?id=objectid&approve=1

The issue I am having is that I can't figure out the syntax for the API call to make it grab the Senor ID from the sensor that I have applied the notification template to. How would I adjust it to do this?

An example of a notification template that does this would be my Auto-Acknowledge one below. It pulls the sensorid into the API call it makes.

https://prtgmon.brotherhoodmutual.com/api/acknowledgealarm.htm?id=%sensorid&ackmsg=Auto-Acknowledged-via-Notification&username=XXXXXX&password=XXXXXXX


Article Comments

Check out PRTGapi's Get-Trigger:
https://github.com/lordmilko/PrtgAPI/wiki/Notification-Triggers

Simply check for the corresponding triggers for the Sensors returned via Get-Sensor -Status Down and you should be good to go :)


PRTGapi | Feature Requests

Kind regards,
Stephan Linke, Tech Support Team


Jul, 2019 - Permalink