Threshold ranges possible?

Started by Millenium7, September 30, 2019, 10:22:00 AM

Previous topic - Next topic

Millenium7

The current threshold options are somewhat limited especially because you can't do 'AND' or 'OR' operations with them
So from what I gather its not possible to do a threshold range? i.e. 'last polled value between 15 and 20'

I have some SNMP values that return -1, 0 or 4,294,967,295 (highest possible value) and I want to create alerts that exclude these
And others return an incorrect value that I just want to discard. I.e. I have temperature alerts set up, anything >70 send a Slack alert, however when its returning 8,500 we've either created a miniature star or the sensor is faulty. As such I don't want to alert on anything >140

Is there a way to do this?

Filipp Sudanov

#1
Since version 3.0 macros can be used in threshold's Value field. Particularly, this allows to use scripts in thresholds by creating a script and referencing it with %[script_name] macro. This way you can do all the customization in your script.
UPD:
More correct way would be to set threshold Function = Script and use a script this way. If script returns "true" it means, that threshold will get activated. Contents of "Value" field can be accessed from the  script. 

Millenium7

I guess its better than nothing but i'm not a fan of scripting when it can be avoided, its just messy, hard to read and hard to make changes or troubleshoot down the track (too many rabbit holes to follow to find what is responsible for what)

Any plans to update threshold options and add the ability to specify multiple values?