Custom check, how to deal with constantly increasing values?

I did a custom check and it is working just fine, except i cannot apply rules to it for logical reasons.
The check tracks the amount of connections a server makes (~50 billion a day) and if it somehow stops to do this for more than 48h it should trigger the warning state. Problem is, I can only get the current value via snmp so I cannot know if the count increased. Is there a way to have access to the previous metrics values?

Check_MK has a function for that - get_rate.

Example from netapp_fcpio :

avg_read = get_rate(“netapp_fcpio.read”, this_time, read)

basically you need to pass the counter name, current_time, and the perf value.

But take a look at some examples on some checks already made and shipped with CMK.

Cheers,

1 Like

Well, get_rate, does not help much here, but this made me find “set_item_state()” and "get_item_state()"which is perfect.
TY :slight_smile: