Ad Widget

Collapse

Simple question - using internal macros in template triggers expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andrey.Gavenko
    Junior Member
    • Jun 2025
    • 4

    #1

    Simple question - using internal macros in template triggers expression

    Hello everyone!

    I'm using zabbix 7.2. I'll try to use the trigger from the book - an error if the device name does not match the name in zabbix:
    Code from example:

    find(/MyTemplate/sysName,,"eq","{HOST.NAME}")=0

    But, in any situation, this expression is considered true. What am I doing wrong?

    The documentation (https://www.zabbix.com/documentation...ed_by_location) states that this macro can be used in trigger expressions.

    Thank you!
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Originally posted by Andrey.Gavenko
    The documentation (https://www.zabbix.com/documentation...ed_by_location) states that this macro can be used in trigger expressions.
    No it cannot .. . There is no "trigger expressions" ...
    {HOST.NAME} → Trigger-based notifications and commands
    → Problem update notifications and commands
    → Internal notifications
    → Map element labels, map URL names and values
    → Item key parameters
    → Host interface IP/DNS
    → Trapper item "Allowed hosts" field
    → Database monitoring additional parameters
    → SSH and Telnet scripts
    → Web monitoring4
    → Low-level discovery rule filter regular expressions
    → URL field of dynamic URL dashboard widget
    → Trigger names, event names, operational data and descriptions
    → Trigger URLs
    Tag names and values
    → Script-type item and Browser-type item, item prototype and discovery rule parameter names and values
    → HTTP agent type item, item prototype and discovery rule fields:
    URL, Query fields, Request body, Headers, SSL certificate file, SSL key file, Allowed hosts
    → Manual host action script commands, confirmation text
    → Manual event action script commands, confirmation text
    → Manual event/host action URLs, confirmation text
    Description parameter in Item value and Gauge widget
    → Primary/Secondary label Text parameter in Honeycomb widget
    → Column of data type Text in Top hosts widget

    Comment

    • Andrey.Gavenko
      Junior Member
      • Jun 2025
      • 4

      #3
      Good day Cyber!

      Thank you very much for your help!
      I thought the phrase "Visible host name. This macro can be used with a numeric index, such as {HOST.NAME<1-9>}, to point to the first, second, third, etc. host in a trigger expression." meant it could be used in expressions.

      Comment

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

        #4
        Unfortunately not... it means you can refer to first, second, etc... host that is used in trigger expression... ie. if you have expression "last(/host1/item)>0 and last(/host2/item)>0 and last(/host3/item)>0" then you can refer to each of those hosts as {HOST.NAME1} or {HOST.NAME2} or {HOST.NAME3}

        Comment

        Working...