Search code examples
triggerszabbix

Zabbix trigger of drop user


My question : is it possible to have a trigger on that item that will be activated if there's a difference of xx% between the two last queries ?

Example :

Query at 01:00 -> 2000 users connected
Query at 01:10 -> 2100 users, difference is positive, we don't care
Query at 01:20 -> 2050 users, -50 users, around 2-3%, no big deal
Query at 01:30 -> 800 users, around 60% less connections, there's something wrong here

Is it possible to have a trigger that activates when the difference is, let's say, 20% negative ?


Solution

  • You can use the abschange function:

    The amount of absolute difference between last and previous values

    to alert for both positive and negative changes.

    Or you can use the last function to get the latest values you need:

    For example:

    last() is always equal to last(#1)

    last(#3) - third most recent value (not three latest values)

    In both cases you need to compute the % value in your trigger with the usual proportion:

    older_value:100 = newer_value:x