Ad Widget

Collapse

Zabbix dependent items & Macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fredo2906
    Junior Member
    • Jan 2011
    • 14

    #1

    Zabbix dependent items & Macro

    Hi,

    I created 2 dependents items key "test.status" and "test.status.url" based on a master item "test".
    I created a trigger on the item "test.status".

    When the trigger is in the PROBLEM state, I want to send a mail which include the last value of the item "test.url", I tried multiple things but without being able to reach what I want.

    For example in the action trigger I have set the custom mail to something like :
    {myhost:test.status.url.last()} => this works

    now I want to have something dynamic and set

    {{HOST.HOST}:{ITEM.KEY}.url.last()} => this is not working

    How can I get the last value of my item using macros ?

    Thanks a lot for the help

  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    You are trying to add data from different item (not used in expression). That does not work... Want to have values in there.. use it in secondary expression (... and myotheritem ...find a function what is always true and will not affect whole calculation) and refer to it as {ITEM.VALUE2}

    Hardcoded item value ({myhost:test.status.url.last()}) is OK.
    https://www.zabbix.com/documentation...ed_by_location
    {host:key.func(param)} → Trigger-based notifications and commands
    → Problem update notifications and commands
    → Map element/shape labels 3
    → Link labels in maps3
    → Graph names5
    → Trigger expressions6
    Simple macros, as used in building trigger expressions.

    Supported for shape labels in maps since 3.4.2.
    Using macros to create simple macro on the fly... that does not work ...

    Comment

    • fredo2906
      Junior Member
      • Jan 2011
      • 14

      #3
      Thanks cyber

      That's a limitation I think, doing so let me use only a maximum of 9 "sub" items/values.

      Imagine I have something like :

      check1 : {json objet}
      check1.status : ok/ng
      check1.status.url : some url
      check1.status.info : some info
      check1.status.res1 : some info
      check1.status.res2 : some info
      check1.status.res3 : some info
      check1.status.res4 : some info
      check1.status.res5 : some info
      check1.status.res5 : some info
      check1.status.res6 : some info
      check1.status.res7 : some info
      ....
      x100 checks

      I need to have a condition like check1.status <> ok or check2.status <> ok or check3.status <> ok .... then trigger an alert and recover only if all are ok. For this master item for example "check1", send an email with all the check[1].status.resX.

      Basically that would resume to 1 trigger and 1 action, but you say not possible.

      Any idea how I could achieve the above?

      Comment

      Working...