The sensor dependency setting is great if you want to pause sensors based on another sensor going down. However, I want to do it the other way around!

I am using an HTTP sensor to check the status of a web server and if it goes down I want to run an SSH Script sensor to restart the server. Is there any way of using a dependency to do this?


Article Comments

Hi,
I'm afraid this is not possible using dependencies. But you may use the PRTG API and a State Trigger firing a HTTP Notification when the sensor goes down.
Just pause the SSH script sensor and create a HTTP notification which does a API call to un-pause and one to pause the sensor. This notification then can be used with a state trigger for the HTTP Sensor which un-pauses the SSH script sensor when the sensor goes to down state and which then pauses the sensor again when the HTTP sensor comes up again ("When Condition clears").
If necessary a third HTTP notification might be created which triggers a scan of the SSH script sensor.
Best regards


Oct, 2012 - Permalink

Thank you! This works perfectly and now means I can automate what has become a laborious manual process on 30 different servers.


Oct, 2012 - Permalink