See www.zabbix.com for the official Zabbix site.

Docs/specs/ZBXNEXT-1286

From Zabbix.org
Jump to: navigation, search

Support of low level discovery macros in trigger expressions

ZBXNEXT-1286

Status: v1.0

Owner: Alexei, Sasha

Summary

Trigger prototypes should support LLD macros in expressions.

Specification

The macros could be used only for standalone constants. For example, macro {#FSTRIGGER}:

{Template_OS_Linux:vfs.fs.size[{#FSNAME},pused].last(0)}>{#FSTRIGGER}

{Template_OS_Linux:vfs.fs.size[{#FSNAME},pused].last(0)}>5*{#FSTRIGGER}

{Template_OS_Linux:vfs.fs.size[{#FSNAME},pused].last(0)}<50 | {#FSTRIGGER}

Details

  • The macros will be expanded by Server when creating real triggers based on the prototypes
    • Macro values should support all valid suffixes supported in trigger expressions (KMGTsmhdw)
    • If a macro cannot be expanded (no value or non-numeric value), a real trigger will not be created.
      • In this case an error message "Cannot create trigger \"%s\": no value for macro \"%s\"." or "Cannot create trigger \"%s\": macro \"%s\" value is not numeric." will be written to discovery rule error field.
  • Front-end will support the LLD macros in trigger prototype expressions

Front-end and API changes

  • Trigger parser should be extended to allow LLD macros in trigger prototypes
  • Trigger prototype related API methods should support new macros

Strings added

  • No new strings needed

Documentation

  • What's new
  • Zabbix Manual: supported macros

Test cases

  • Macro in a wrong place of trigger prototype expression
  • Macro with non-numeric value
  • Use of non-existent macro

ChangeLog

  • N/A