

User Tools

Site Tools



This is an old revision of the document!

8 Forecasting trigger functions


Sometimes there are signs of the upcoming problem. These signs can be spotted so that actions may be taken in advance to prevent or at least minimize the impact of the problem. Zabbix has tools to predict the future behaviour of the monitored system based on historic data.

1 Functions

Two things one needs to know is how to define a problem state and how much time is needed to take action. Then there are two ways to set up a trigger signalling about a potential unwanted situation. First: trigger must fire when system after “time to act” is expected to be in problem state. Second: trigger must fire when system is going to reach the problem state in less than “time to act”. Corresponding trigger functions to use are forecast and timeleft. Note that underlying statistical analysis is basically identical for both functions. You may set up a trigger whichever way you prefer with similar results.

2 Parameters


2.1 Time interval


2.2 Forecasting horizon

(forecast only)
Parameter time specifies how far in the future Zabbix should extrapolate dependencies it finds in historic data. No matter you use time_shift or not, time is always counted starting from the current moment.

2.3 Threshold to reach

(timeleft only)
Parameter threshold specifies a value analysed item has to reach, no difference from above or from below. Once we have determined f(t) (see below) we should solve equation f(t) = threshold and return the root which is closer to now and to the right from now or 999999999999.9999 if there is no such root.

2.4 Fit functions

Default fit is linear function. But if your monitored system is more complicated you have more options to choose from.

fit x = f(t)
linear x = a + b*t
exponential x = a*exp(b*t)
logarithmic x = a + b*log(t)
power x = a*tb
2.5 Modes

(forecast only)
Every time trigger function is evaluated it gets data from specified history period and fits a specified function to the data. So, if the data is slightly different the fitted function will slightly different. If we simply calculate the value of the fitted function at specified time in the future you will know nothing about how analysed item is expected to behave between now and that moment in the future. For some fit options (like polynomial) simple value from the future may be misleading.

mode forecast result
value f(now + time)
delta max - min

3 Details


4 Potential errors

Functions return -1 in such situations:

  • specified evaluation period contains no data;
  • result of mathematical operation is not defined2);


Polynomial degree can be from 1 to 6, polynomial1 is equivalent to linear. However, use higher degree polynomials with caution (More info here). If the evaluation period contains less points than needed to determine polynomial coefficients, polynomial degree will be lowered (e.g polynomial5 is requested, but there are only 4 points, therefore polynomial3 will be fitted).