Ad Widget

Collapse

Custom values in alert emails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maplesyrupghost
    Member
    • Jul 2012
    • 37

    #1

    Custom values in alert emails

    Hey!

    Trying to customize the messages that zabbix sends out in the emails.

    Found the macros page, definitely handy and I have put in as much information as possible using the default macros.

    Now I am trying to include other information from other values other than those that triggered during the event. Like, if I have an item that is graphing the ping times in milliseconds, how can I include the last 10 ping times in that message?

    I think it has to do something with the trigger expressions but it isn't very clear how to do it.

    The layout is: {<server>:<key>.<function>(<parameter>)}<operator> <constant>

    If I try something like:

    {{HOST.NAME1}:icmppingsec.last(0)}

    or

    {{HOST.NAME1}:icmppingsec[, 5, 900, , , max].last(0)}

    It displays the host name, and the rest comes as plain text.

    Help ? Thanks!
  • maplesyrupghost
    Member
    • Jul 2012
    • 37

    #2
    ah, I just got it to work by specifying an individual machine.

    can I make it so it grabs the host that is causing the trigger and use it in the expression?

    Comment

    • egena
      Junior Member
      • Oct 2013
      • 6

      #3
      Good tip - thanks!

      I've been wanting to find out how to add a host name to an email notifications' subject as my Android phone predominantly shows a Subject line before content. I have adjusted the templates I needed to now simply include the;

      {HOST.NAME1}

      ... that you mentioned and there it is!

      Thanks again!

      Comment

      • jan.garaj
        Senior Member
        Zabbix Certified Specialist
        • Jan 2010
        • 506

        #4
        {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}
        or if you have more items used in trigger, then other items/values are:
        {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}
        ... etc

        Reference:
        Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
        My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

        Comment

        • egena
          Junior Member
          • Oct 2013
          • 6

          #5
          Excellent!

          Thanks Jan

          Comment

          Working...