Using previous data from a data point
I am trying to use the previous data from the data point Status to create a specific alert with the StatusFlap datapoint. I want to keep the StatusFlap datapoint enabled but after each time an interface comes back online after being offline, the StatusFlap alert also notifies my team. Basically, I want to find a way to only alert if the Status datapoint has an output of 1 in two consecutive polls and StatusFlap datapoint has an output of 1. I tried to modify the script but found out that LogicMonitor does not allow stateful collection scripts.
Is there any way I could go about this?
jbreynolds
Posted 7 months ago·Last reply 7 months ago
4 comments
Mike Moniz
·7 months agoSounds like you can create a complex datapoint that looks something like this (did not test): if(eq(Status,1),StatusFlap,0) which will only use the value of StatusFlap if Status is 1. Then look at the Delta thresholds for this new datapoint. Something like Delta =1, would alert one time when it transition from 0 to 1, but not if it stays a 1 or goes back to 0. Use Absolute Delta if you want to alert when it transitions from 0 to 1 or from 1 to 0. After that you can then remove the threshold for the original StatusFlap as this new datapoint covers it.
Just keep in mind it will only alert one time during the transition then clear itself. I've seen team members just close tickets with just "alert cleared" without realizing that is expected and is still something that needs to be looked at.
https://www.logicmonitor.com/support/alerts/about-alerts/static-thresholds-for-datapoints#:~:text=Delta
jbreynolds
OP7 months agoThis is definitely a good starting point, thank you. The expression you provided doesn't work exactly since it will alert once the interface comes back online. Using an equation like this and using the Delta thresholds is the way I will most likely go about this.
Currently I have the expression:
if(eq(Status,1),StatusFlap,0)+if(eq(Status,2),Status,0) with a threshold of Delta = 1, but it will give "No Data" when the Status has a value of 2 and StatusFlap of 0. Do you know why this is?
jbreynolds
OP7 months agoI found out that I had the valid value range between -1 and 1.
jbreynolds
OP7 months agoThe expression above has tested correctly so far. Thank you for the help Mike!