Ad Widget

Collapse

how show the current value in trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmw
    Junior Member
    • Nov 2010
    • 14

    #1

    how show the current value in trigger name

    Hi,

    I want to install a trigger with the current value in the name.
    The trigger has the following expression:
    {Template_jammysql:mysql.status.slaveBehindMaster. last(0)}>180

    The name should be something like:
    MySQL Replication on {HOSTNAME} is {1} seconds behind the master

    But {1} as placeholder doesn't work. Is there a placeholder, that holds the current value?

    thanks a lot in advance
    jmw
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    Originally posted by jmw
    I want to install a trigger with the current value in the name.
    The trigger has the following expression:
    {Template_jammysql:mysql.status.slaveBehindMaster. last(0)}>180

    The name should be something like:
    MySQL Replication on {HOSTNAME} is {1} seconds behind the master

    But {1} as placeholder doesn't work. Is there a placeholder, that holds the current value?
    Proper syntax would be:
    Code:
    MySQL Replication on {HOSTNAME} is {Template_jammysql:mysql.status.slaveBehindMaster.last(0)} seconds behind the master
    But, item values in trigger descriptions are not supported according to documentation (http://www.zabbix.com/documentation/.../config/macros).

    {host:key.func(param)} is only supported in Notifications and commands, Map labels, Trigger expressions.

    Regards,
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • untergeek
      Senior Member
      Zabbix Certified Specialist
      • Jun 2009
      • 512

      #3
      Shouldn't this work with {ITEM.LASTVALUE1} instead of {1}?

      I can't tell if you're trying to put that value in a trigger for an unrelated item or if it's for the item itself. My answer presumes that the item itself is what the trigger is about. In that case, {ITEM.LASTVALUE1} will work.

      If you reference multiple items in your trigger definition, you can use up to {ITEM.LASTVALUE9}

      I frequently have built triggers with erroneous checks (e.g., str(NULL)=0) just so I could include a value in the trigger title, so it would show up in an alert subject line.
      Last edited by untergeek; 09-12-2010, 20:01. Reason: added clarification.

      Comment

      • untergeek
        Senior Member
        Zabbix Certified Specialist
        • Jun 2009
        • 512

        #4
        My information about the macro {ITEM.LASTVALUE1-9} is here:

        http://www.zabbix.com/documentation/.../config/macros

        Comment

        • zalex_ua
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Oct 2009
          • 1286

          #5
          Originally posted by jmw
          I want to install a trigger with the current value in the name.
          The trigger has the following expression:
          {Template_jammysql:mysql.status.slaveBehindMaster. last(0)}>180

          The name should be something like:
          MySQL Replication on {HOSTNAME} is {1} seconds behind the master
          Macro {ITEM.VALUE} is supported for trigger names !!!
          See some pictures as proof.

          Replace you {1} with {ITEM.VALUE} and all should be fine.

          Macro {ITEM.LASTVALUE} also works, but is different. It not display Historical data (when event happened), it display simply latest value.

          Comment

          • alixen
            Senior Member
            • Apr 2006
            • 474

            #6
            Hi zalex_ua,

            Originally posted by zalex_ua
            Macro {ITEM.VALUE} is supported for trigger names !!!
            See some pictures as proof.

            Replace you {1} with {ITEM.VALUE} and all should be fine.

            Macro {ITEM.LASTVALUE} also works, but is different. It not display Historical data (when event happened), it display simply latest value.
            Thank you for pointing to {ITEM.VALUE} and {ITEM.LASTVALUE}.
            I missed them, I will probably use them in my trigger descriptions.

            Regards,
            Alixen
            http://www.alixen.fr/zabbix.html

            Comment

            Working...