
Michael Finney (Customer) asked a question.
I am trying to figure out a way to automatically acknowledge alerts as an action step that comes after the email step. I see the article with the jscript to acknowledge everything, but that isn't really helpful overall. I always try to avoid the sledgehammer approach when a more discrete result is needed.
Is there any way to modify that script to target only the device to which the alert is linked? Could the ActiveMonitorStateChangeLog query WHERE clause be modified to a linked device name variable instead of bAcknowledged? What about the Device query?
I was also looking at the WUG API as I used the API approach to set up an auto-acknowledgement action on PRTG for another job, but I can't see any way so far to acknowledge via the API. Am I missing anything there please?
Thank you!
Mike
It would be possible, but it would involve creating multiple queries in the script to get all of the active and passive monitors which are unacknowledged and then loop through the list to update each one, for the active monitors and passive monitors, and update the device table as well for that one device.
I did add a Feature Request to add a new API endpoint to acknowledge a single or multiple devices.
I guess it wouldn't work just to query for the deviceid and then acknowledge it? I was hoping that would be equivalent to right clicking on the device in the UI and selecting Acknowledge Device but maybe that is doing more behind the scenes with the monitors than it appears.
That you for adding that feature request, most appreciated.
Doing that, sets the device in the device table to Acknowledged to a 1 for both active and passive monitors, then in the Active Monitor State Change Log for ALL monitor logs associated with the monitors on that device, and the same for the Passive Monitor State Change Log. So there would need to be a query to pull all monitors for that Active Monitor State Change Log, then loop though all of those to do an update query to set the value for Acknowledged to a 1 for each, then do the same for Passive monitor, and then update the device in the device table.
Go vote up that Feature request.