• 0

Complex Datapoint and limit


I am writing a custom datasource for a temperature monitor. We want to alert on if the temperature falls to high or to low. I figured limit would be what we want.

This is what I have so far, no matter what it returns 0 tho. I have adjusted the numbers so Temperature falls outside and inside the range and it always returns 0. 

if(limit(Temperature, 46, 60), 0, 1)

Is my understanding of this wrong?


Eventually I would chain this to return different numbers based on Error and Critical thresholds, but can't get this even started lol.

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Based on the Limit documentation and without testing it, you have the right understanding. This would report 0 if ok and 1 if under/over but this also means the alert it would generate wouldn't provide any details like what is the temp actually is.

Perhaps you can try having two complex datapoints called something like UnderTemp and OverTemp which each just have an expression of "Temperature" (basically cloning the normal datapoint) but one you can set thresholds of < 46 and the other > 60. That way you can report both that the temp was over/under with custom messages and have the temperature right in the alert. Makes it also easy to do warn/error/crit.

Actually you can just clone the original Temperature datapoint without having to use complex datapoints (Poll Now would work this way) but I think complex Datapoints would make it more clear.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.