Accessing the previous row of data on a datasource
Hi,
I am trying to create a datasource that compares current row of data with the previous reading.
What is the best way of accessing a previous row of data?
Thank you,
Tom.
mr_t
Posted 4 years ago·Last reply 4 years ago
6 comments
mr_t
OP4 years agoThanks Stuart. I will give collector script caching a go.
LM User
·4 years agoWith Collector script caching, you could poll more frequently, but still carry forward a rolling list of the last 12 values (in a list/array, shifting every time there's a new poll). Add a complex datapoint that is the delta between the current polled value and the oldest value in the list with a threshold of 10.
Mike Moniz
·4 years agoHmm, I would try cloning the existing disk check, change it to run every 12 hours, and set the percent free/used to have a ABS Delta of 10 ( |> 10 ) and set for immediate alert. Although one issue with this setup is that any alerts will also take 12 hours to clear.
LM User
·4 years ago+1: if this is for alerting purposes, just use the delta threshold options.
If you want to actually graph the difference, you might consider either the LM API, or the easier collector script caching.
Mike Moniz
·4 years agoIf this is for threshold purposes then you can look into the Delta threshold options. Otherwise you likely need to use the LM API within the DataSource to pull the device's raw data. If you can describe what you are attempting to do more generally (aka why), there might be another way to do what you want.