Ad Widget

Collapse

Macro {item.id}

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bernard
    Member
    • Oct 2008
    • 54

    #1

    Macro {item.id}

    Hi everybody,

    Is there a macro ITEM.ID into triggers or alerts ?
    I want to build a URL wich point to item's history.

    Example into a trigger configuration:

    Trigger url: http://myzabbixserver.com/history.php?action=showgraph&itemid={ITEM.ID}

    Best Regards
  • exkg
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified Specialist
    • Mar 2007
    • 718

    #2
    Hi,

    Unfortunatly not. But its a good idea.
    Can you post it in NEXT version wish list.

    We have a patch (ugly, not usable for other) to this ....

    Alexei,

    What cost to create this new MACRO ? Its possible ?


    []s,
    Luciano
    --
    Luciano Alves
    www.zabbix.com
    Brazil | México | Argentina | Colômbia | Chile
    Zabbix Performance Tuning

    Comment

    • NOB
      Senior Member
      Zabbix Certified Specialist
      • Mar 2007
      • 469

      #3
      It's there

      Hi bernard

      Originally posted by bernard
      Hi everybody,

      Is there a macro ITEM.ID into triggers or alerts ?
      I want to build a URL wich point to item's history.

      Example into a trigger configuration:

      Trigger url: http://myzabbixserver.com/history.php?action=showgraph&itemid={ITEM.ID}

      Best Regards
      If you just want to look at the Latest Data of the item: it's already
      there.
      Just open the Filter and select Show details. The
      link to the latest data is shown together with the trigger description.
      Klick on item in the trigger expression and there you go.

      If you want dynamic URLs (as we call it) for the trigger itself,
      you're right. This is missing.
      We have a patch that will open a Help page, e.g., to show the required actions to fix this issue or instructions what to do next (calling
      somebody, etc.).
      Macros {HOSTNAME} and {TRIGGERNAME} are replaced by our modified frontend.

      Regards

      Norbert.
      Last edited by NOB; 19-10-2009, 12:34.

      Comment

      • bernard
        Member
        • Oct 2008
        • 54

        #4
        Thanks

        Hi Norbert & Luciano,
        Thanks for your answers.
        I "just" wanna to build an URL containing history about the trigger into the action message (one dynamic URL for all triggers into an action).
        I will wait next release if macro is available.
        Best regards,
        Bernard

        Comment

        • machtech
          Junior Member
          • Jan 2010
          • 11

          #5
          We are also hoping to implement this in the Alert email communications template, eg:

          HTML Code:
          Latest Data: https://zabbix.ourdomain.net.au/history.php?action=showgraph&itemid={ITEM.ID}
          Note the only issue with the above is the {ITEM.ID} macro does not fill with the same value had you clicked into the link on the Latest Data field via the web gui.

          We think this will be a fabulous capability, as it is very powerful to be able to see an email alert on your iPhone, then click on this link to see the latest graph or table of values for the item :-)

          This is not yet picked up in 1.8.2 - is there a desire from the community to see this in the next release?

          Cheers

          Paul

          Comment

          • Murz
            Junior Member
            • Sep 2008
            • 17

            #6
            Here is feature request about this: https://support.zabbix.com/browse/ZBXNEXT-21 - let's vote and hope that this will be implemented!

            Comment

            • kloczek
              Senior Member
              • Jun 2006
              • 1771

              #7
              Originally posted by Murz
              Here is feature request about this: https://support.zabbix.com/browse/ZBXNEXT-21 - let's vote and hope that this will be implemented!
              Before open request you should check list of available macros.
              On https://www.zabbix.com/documentation...ed_by_location list you can find {TRIGGER.URL} macro.
              http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
              https://kloczek.wordpress.com/
              zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
              My zabbix templates https://github.com/kloczek/zabbix-templates

              Comment

              • Murz
                Junior Member
                • Sep 2008
                • 17

                #8
                Originally posted by kloczek
                Before open request you should check list of available macros.
                On https://www.zabbix.com/documentation...ed_by_location list you can find {TRIGGER.URL} macro.
                The {TRIGGER.URL} is going in default template, but it always empty on all my Zabbix installs (in 3.2 version too), here is example:

                Code:
                Trigger: Free disk space is less than 20% on volume /srv/sites
                Trigger status: PROBLEM
                Trigger severity: Warning
                Trigger URL: 
                
                Item values:
                
                1. Free disk space on /srv/sites (percentage) (zabbix:vfs.fs.size[/srv/sites,pfree]): 17.72 %
                2. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
                3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
                
                Original event ID: 5906
                Template text:
                Trigger: {TRIGGER.NAME}
                Trigger status: {TRIGGER.STATUS}
                Trigger severity: {TRIGGER.SEVERITY}
                Trigger URL: {TRIGGER.URL}

                Item values:

                1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}
                2. {ITEM.NAME2} ({HOST.NAME2}:{ITEM.KEY2}): {ITEM.VALUE2}
                3. {ITEM.NAME3} ({HOST.NAME3}:{ITEM.KEY3}): {ITEM.VALUE3}

                Original event ID: {EVENT.ID}
                And I don't reopen issue, this issue was already open and not resolved.

                Comment

                • Murz
                  Junior Member
                  • Sep 2008
                  • 17

                  #9
                  Seems that {EVENT.ID} already works normally on Zabbix 3.2, so we can generate direct links to item history in action text, here is example:
                  Code:
                  Item graph: xttp://zabbix.example.com/history.php?action=showgraph&itemids[]={ITEM.ID1}
                  Item history: xttp://xttp://zabbix.example.com/history.php?action=showvalues&itemids[]={ITEM.ID1}
                  Graph direct image: <img src="xttp://xttp://zabbix.example.com/chart.php?itemids[]={ITEM.ID1}" />
                  Last edited by Murz; 17-02-2017, 17:22.

                  Comment

                  • f1_cone
                    Junior Member
                    • Oct 2022
                    • 3

                    #10
                    This isn't working for me in 6.0.9 but did in an earlier release, does anyone else have it working in 6 at all and does your trigger URL appear any different to the syntax from Murz above, i.e.:

                    http://zabbix.example/com/history.ph...wgraph&itemids[]={ITEM.ID}

                    or:

                    http://zabbix.example/com/history.ph...wgraph&itemids[]={ITEM.ID}

                    I can successfully parse the {ITEM.ID} macro into messages but the trigger URL doesn't seem to populate with the ITEM.ID.

                    Comment

                    Working...