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

Docs/specs/ZBXNEXT-1643

From Zabbix.org
Jump to: navigation, search

New notification macros {TRIGGER.TEMPLATE.NAME} and {TRIGGER.HOSTGROUP.NAME}

ZBXNEXT-1643

Status: Final

Owner: -

Summary

{TRIGGER.TEMPLATE.NAME} should return sorted comma-space separated list of templates in which the trigger is defined or *UNKNOWN* if the trigger is defined in a host.

{TRIGGER.HOSTGROUP.NAME} should return sorted comma-space separated list of host groups in which the trigger is defined.

Specification

If trigger is based on a trigger prototype macro should return list of templates in which the trigger prototype is defined.

Details

  • If a trigger expression contains several hosts and these hosts belong to different groups, the macro returns the list of all groups from all of these hosts (for example, group_a, group_c, group_d, group_e).
  • List of host groups and templates will be sorted by SQL query.
  • For messages, only objects with at least read permissions will be in lists. For commands, permissions won't be checked.

Examples

Example 1
  • Trigger expression: {hostA:item.last(0)} | {hostB:item.last(0)}
  • hostA belongs to groups groupA and groupD
  • hostB belongs to groups groupA, groupC and groupE

The macro should return: groupA, groupC, groupD, groupE

Example 2
template1 => template2 => host (template2, template3)
trigger1 {template1:item1.last(0)} => template1:triger1 {template2:item1.last(0)} => template1:triger1 {host:item1.last(0)}
trigger2 {template2:item2.last(0)}
trigger3 {template2:item2.last(0)}&{template3:item3.last(0)}
=> template2:triger2 {host:item2.last(0)}
template3
trigger3 {template2:item2.last(0)}&{template3:item3.last(0)} => template2,template3:triger3 {host:item2.last(0)}&{host:item3.last(0)}
triger4 {host:item4.last(0)}

The macro should return:

  • template1 for event from trigger1
  • template2 for event from trigger2
  • template2, template3 for event from trigger3
  • *UNKNOWN* for event from trigger4

API changes

None

Translation strings

None

Database changes

None

Documentation

  • What's new for 2.0.6
  • Macro table

Test cases

ChangeLog

  • N/A