概述

    由Zabbix提供支持完整的宏列表

    示例

    这里的例子说明了如何在消息中使用宏。

    示例 1

    Message subject:

    收到消息后,消息主题将被替换为:

    1. zabbix.zabbix.com服务器上的处理器负载太高: PROBLEM
    示例 2

    Message:

    1. Processor load is: {zabbix.zabbix.com:system.cpu.load[,avg1].last()}
    示例E 3

    Message:

    1. Latest value: {{HOST.HOST}:{ITEM.KEY}.last()}
    2. MAX for 15 minutes: {{HOST.HOST}:{ITEM.KEY}.max(900)}
    3. MIN for 15 minutes: {{HOST.HOST}:{ITEM.KEY}.min(900)}

    收到消息时,消息将被替换为:

    1. Latest value: 1.45
    2. MIN for 15 minutes: 1.01
    示例 4

    Message:

    When you receive the message, it will contain a link to all events of the problem trigger.

    示例 5

    Informing about values from several hosts in a trigger expression.

    1. Trigger: {TRIGGER.NAME}
    2. Trigger expression: {TRIGGER.EXPRESSION}
    3.  
    4. 1. Item value on {HOST.NAME1}: {ITEM.VALUE1} ({ITEM.NAME1})
    5. 2. Item value on {HOST.NAME2}: {ITEM.VALUE2} ({ITEM.NAME2})

    When you receive the message, the message will be replaced by something like:

    1. Trigger: Processor load is too high on a local host
    2. Trigger expression: {Myhost:system.cpu.load[percpu,avg1].last()}>5 | {Myotherhost:system.cpu.load[percpu,avg1].last()}>5
    3.  
    4. 1. Item value on Myhost: 0.83 (Processor load (1 min average per core))
    5. 2. Item value on Myotherhost: 5.125 (Processor load (1 min average per core))
    示例6

    Receiving details of both the problem event and recovery event in a recovery message:

    Message:

    When you receive the message, the macros will be replaced by something like:

    1. Problem:
    2.  
    3. Event ID: 21874
    4. Event status: PROBLEM
    5. Event time: 13:04:30
    6. Event date: 2014.01.02
    7. Event age: 5m
    8. Event acknowledgement: Yes
    9. Event acknowledgement history: 2014.01.02 13:05:51 "John Smith (Admin)"
    10. -acknowledged-
    11.  
    12. Recovery:
    13.  
    14. Event ID: 21896
    15. Event value: 0
    16. Event status: OK
    17. Event time: 13:10:07

    Zabbix 2.2.0之后支持原始问题事件和恢复事件的单独通知宏。