Context macro find (regexp) trigger expression on autoregistered hosts

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 6.0.2
    • Component/s: Server (S)
    • None
    • Environment:
      Debian 11
      MariaDB 10.5.12

      Steps to reproduce:

      Create a template containing discovery and trigger expression using find function and regexp together with context macro, eq:

      find(/template/key[{#LLDMACRO}],,"regexp","{$MACRO:\"{#LLDMACRO}\"}")=0 

      Add this template to host manually and trigger expression gets added correctly under the discovery.

      Now create autoregistration action to automatically add a new host and create operation that adds previously created template to new host. Register host and observe the trigger expression added by the template, it looks like this with the extra backslashes:

      find(/template/key[{#LLDMACRO}],,"regexp","{$MACRO:\\"{#LLDMACRO}\\"}")=0 

      Which effectively means that LDDMACRO isn't expanded and regexp fails.

      Result:
      For some reason autoregistration adds extra backslashes to trigger expression found from template. I skipped 5.4 and went directly from 5.0 -> 6.0 so not sure if it was introduced with new trigger expressions in 5.4 or later on in 6.0. My current environment is running latest 6.0.2 version.
      Expected:
      Trigger expression remains unchanged no matter how the template is added to a host.

            Assignee:
            Zabbix Development Team
            Reporter:
            Roni Väyrynen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: