Details
-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
6.0.2
-
None
-
Debian 11
MariaDB 10.5.12
Description
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.