Zabbix Documentation 2.4

2.23.04.0 (current)In development:4.2 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:config:triggers:expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
manual:config:triggers:expression [2017/10/13 05:38]
martins-v updating an old, outdated note about triggers using history
manual:config:triggers:expression [2017/10/13 11:28] (current)
martins-v values required for trigger evaluation are cached by Zabbix server
Line 8: Line 8:
   {<​server>:<​key>​.<​function>​(<​parameter>​)}<​operator><​constant>​   {<​server>:<​key>​.<​function>​(<​parameter>​)}<​operator><​constant>​
  
-=== Functions ===+=== Functions ===
  
 Trigger functions allow to reference the collected values, current time and other factors. Trigger functions allow to reference the collected values, current time and other factors.
Line 14: Line 14:
 A complete list of [[manual:​appendix:​triggers:​functions|supported functions]] is available. A complete list of [[manual:​appendix:​triggers:​functions|supported functions]] is available.
  
-=== Function parameters ===+=== Function parameters ===
  
 Most of numeric functions accept the number of seconds as a parameter. ​ Most of numeric functions accept the number of seconds as a parameter. ​
Line 27: Line 27:
  
 Several functions support an additional, second ''​time_shift''​ parameter. This parameter allows to reference data from a period of time in the past. For example, **avg(1h,​1d)** will return the average value for an hour one day ago. Several functions support an additional, second ''​time_shift''​ parameter. This parameter allows to reference data from a period of time in the past. For example, **avg(1h,​1d)** will return the average value for an hour one day ago.
- 
-<note tip>​Triggers evaluate information from the value cache or, if not present, from history. If neither is not available (especially relevant for time shift), trend information is not used, thus history must be kept for at least the period trigger functions expect it.</​note>​ 
  
 You can use the supported [[suffixes|unit symbols]] in trigger expressions,​ for example '​5m'​ (minutes) instead of '​300'​ seconds or '​1d'​ (day) instead of '​86400'​ seconds. '​1K'​ will stand for '​1024'​ bytes. You can use the supported [[suffixes|unit symbols]] in trigger expressions,​ for example '​5m'​ (minutes) instead of '​300'​ seconds or '​1d'​ (day) instead of '​86400'​ seconds. '​1K'​ will stand for '​1024'​ bytes.
  
-=== Operators ===+=== Operators ===
  
 The following operators are supported for triggers **(in descending priority of execution)**:​ The following operators are supported for triggers **(in descending priority of execution)**:​
Line 62: Line 60:
   * **or** shall yield '​1'​ if either of its operands compare unequal to '​0';​ otherwise, it yields '​0'; ​   * **or** shall yield '​1'​ if either of its operands compare unequal to '​0';​ otherwise, it yields '​0'; ​
   * The result of the logical negation operator **not** is '​0'​ if the value of its operand compares unequal to '​0';​ '​1'​ if the value of its operand compares equal to '​0'​.   * The result of the logical negation operator **not** is '​0'​ if the value of its operand compares unequal to '​0';​ '​1'​ if the value of its operand compares equal to '​0'​.
-=== Examples of triggers ===+ 
 +=== Value caching === 
 + 
 +Values required for trigger evaluation are cached by Zabbix server. Because of this trigger evaluation causes a higher database load for some time after the server restarts. The value cache is not cleared when item history values are removed (either manually or by housekeeper),​ so the server will use the cached values until they are older than the time periods defined in trigger functions or server is restarted. 
 + 
 +=== Examples of triggers ===
  
 == Example 1 == == Example 1 ==
Line 127: Line 130:
   {zabbix:​system.cpu.load[all,​avg1].min(5m)}>​2 and {zabbix:​system.cpu.load[all,​avg1].time()}>​000000 and {zabbix:​system.cpu.load[all,​avg1].time()}<​060000   {zabbix:​system.cpu.load[all,​avg1].min(5m)}>​2 and {zabbix:​system.cpu.load[all,​avg1].time()}>​000000 and {zabbix:​system.cpu.load[all,​avg1].time()}<​060000
 The trigger may change its status to true, only at night (00:​00-06:​00) time. The trigger may change its status to true, only at night (00:​00-06:​00) time.
- 
  
 == Example 10 == == Example 10 ==
Line 160: Line 162:
 The trigger will fire if at least two of the triggers in the expression are over 5. The trigger will fire if at least two of the triggers in the expression are over 5.
  
-=== Hysteresis ===+=== Hysteresis ===
  
 Sometimes a trigger must have different conditions for different states. For example, we would like to define a trigger which would become PROBLEM when server room temperature is higher than 20C while it should stay in the state until temperature will not become lower than 15C. Sometimes a trigger must have different conditions for different states. For example, we would like to define a trigger which would become PROBLEM when server room temperature is higher than 20C while it should stay in the state until temperature will not become lower than 15C.