Forum Discussion

mr_t's avatar
3 years ago

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.

6 Replies

  • If 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.

  • Anonymous's avatar
    Anonymous

    +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.

  • Hey, thanks for the replies. I would like to create a disk alert every time there is a 10% change in free space in a 12h period. For example: if percent used on drive D went from 55% to 65% trigger an alert. 

    @Mike MonizI will research Delta threshold but if you could point me in the right direction, I would be extremely grateful.

    Thank you.

  • Hmm, 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.

  • Anonymous's avatar
    Anonymous

    With 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.

  • Thanks Stuart. I will give collector script caching a go.