Forum Discussion
Jeremy,
One way to do this is to write a powershell script that checks the time now, and if its between 1 a.m. and 2 .a.m runs the query, if not does nothing but report the values returned from the last time it ran.
Incorporate this into a datasource and its only going to run the query at that time. You set the ds to run every hour, but it wont run the query until the right time.
David
Thanks David. That's a good approach. I was using the a JDBC query directly within the datasource but it should be straightforward to move it into a PowerShell script. I will give that at try.
@Dave Lee Q, Do you have a sample script on how to return the last value? Is there some built-in api to get the prev value? should I store it in a file and just use that value?
@DanAvni, you could query the rest API for the last datapoint, however it's most effective just store the last values in a file on the collector and pick that up during the off hours.
Related Content
- 2 years ago