Can the API be used to change a sensor's status to "OK"? And if so, can that API call count as a "last scanned" time?
Article Comments
You can initiate a "scan now" on a specified sensor with the API, that will set the "last scanned time"
What exactly is it you are trying to accomplish?
Oct, 2011 - Permalink
Trying to set up a sensor that is essentially a timer. We will have a process or program elsewhere that, when run successfully, will execute a "reset" on this timer. This way we will be able to know that when that sensor is green, the process has run successfully no more than X minutes ago.
Another scenario: We want a sensor whose state is entirely determined by an API call. That would be amazing. We could monitor anything that could be programmed to send a GET request. It would be a revelation in monitoring!! But the first paragraph is where we're at now. Many thanks to this company and the KB community.
Oct, 2011 - Permalink
With PRTG 9 You can setup a "Green IT" sensor and have your program perform a "scan now" on this sensor using the API. Next you can write a custom sensor that calculates the number of seconds since the last run of the "Green IT" sensor.
As for the Other scenario: If you setup a File sensor and have it check for a file (that always exists) on the local probe, it will always be "green". Next have your application use the /api/setobjectproperty.htm call, to change the sensors filename property to a file that does not exist and the sensor will turn red.
Oct, 2011 - Permalink
Hello,
only if the sensor (which you are targeting with the API-Call) is in a simulated error-state, then you could use an API Call to 'resume' the sensor. Otherwise not.
best regards.
Oct, 2011 - Permalink