Ad Widget

Collapse

Edit message in notify mail content by using some macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phupn
    Junior Member
    • Dec 2012
    • 4

    #1

    Edit message in notify mail content by using some macros

    Hi everyone,
    Actually, I want to add some information when a trigger alert to my email. Example: when I receive a warning mail from zabbix system about process load too high like this:
    1. Processor load (xxxxx:system.cpu.load[,avg1]): 5.25
    2. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
    3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
    I want to view more information about CPU like xxxxx.system.cpu.util =? attached with this email instead of logging into zabbix to view details.
    Any idea help me to configure to this situation? Thank you so much for your help.
    My configuration of my email message and send by external script.
    Trigger: {TRIGGER.NAME}
    Trigger status: {TRIGGER.STATUS}
    Trigger severity: {TRIGGER.SEVERITY}
    Trigger URL: {TRIGGER.URL}

    Item values:

    1. {ITEM.NAME1} ({HOSTNAME1}:{TRIGGER.KEY1}): {ITEM.VALUE1}
    2. {ITEM.NAME2} ({HOSTNAME2}:{TRIGGER.KEY2}): {ITEM.VALUE2}
    3. {ITEM.NAME3} ({HOSTNAME3}:{TRIGGER.KEY3}): {ITEM.VALUE3}
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    try {{HOST.HOST}:system.cpu.util[...].last(0)}

    of course, use correct item key parameters, as per items you have
    Zabbix 3.0 Network Monitoring book

    Comment

    • phupn
      Junior Member
      • Dec 2012
      • 4

      #3
      Thank you for your help. I will try this.

      Comment

      • phupn
        Junior Member
        • Dec 2012
        • 4

        #4
        I already edit the message like this:
        .....
        1. {ITEM.NAME1} ({HOSTNAME1}:{TRIGGER.KEY1}): {ITEM.VALUE1}
        cpu.util:{{HOST.NAME1}:system.cpu.util[,system,avg1].last(0)}
        2. {ITEM.NAME2} ({HOSTNAME2}:{TRIGGER.KEY2}): {ITEM.VALUE2}
        ......
        The notify reply:
        1. Processor load (xxxxxx:system.cpu.load[,avg1]): 5.03
        cpu.util:{{HOST.NAME1}:system.cpu.util[,system,avg1].last(0)}
        Can you help me more about the right expression or documentation about this?

        Comment

        Working...