[ZBXNEXT-9208] New macro functions, web scenario improvements Created: 2024 May 30  Updated: 2024 Nov 19  Resolved: 2024 Nov 05

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: 7.0.4rc1, 7.2.0alpha1

Type: Epic Priority: Trivial
Reporter: Juris Bregis Assignee: Sergejs Boidenko
Resolution: Fixed Votes: 2
Labels: Zabbix7.2
Remaining Estimate: Not Specified
Time Spent: 16h
Original Estimate: Not Specified

Issue Links:
Causes
causes ZBX-25445 Some numbers from the macro value are... Closed
Duplicate
is duplicated by ZBXNEXT-9395 HTML escaping in an HTML e-mail media... Closed
is duplicated by ZBXNEXT-8210 new macro function: Replace Closed
is duplicated by ZBXNEXT-3341 Automatically map unsupported charact... Closed
is duplicated by ZBXNEXT-4452 Edit macro variables values extracted... Closed
is duplicated by ZBXNEXT-5299 Decoding HTML for macros/variables in... Closed
is duplicated by ZBXNEXT-6099 uppercase() and lowercase() function ... Closed
is duplicated by ZBXNEXT-8488 Remove trailing backslashes for Windo... Closed
is duplicated by ZBXNEXT-7965 Macro function urlencode Closed
is duplicated by ZBXNEXT-8747 New macro function: base64_encode/decode Closed
Sub-task
Epic Name: Macro Functions
Team: Team A
Sprint: Prev.Sprint, S24-W34/35
Story Points: 14

 Comments   
Comment by Sergejs Boidenko [ 2024 Sep 10 ]

Implemented in:

Comment by Martins Valkovskis [ 2024 Sep 11 ]

Updated documentation:

  • What's new: 7.0.4
  • Macro functions: 7.0, 7.2
  • Web scenario: 7.0, 7.2 (see 'Variables' parameter)
Comment by Norbert Püschel [ 2024 Nov 02 ]

I fail to see how this - really nice improvement - fixes my problem described in ZBXNEXT-8488

I tried using regrepl to remove the trailing slash from {#FSNAME} for Windows-VMs, but I failed. Please explain.
<sboidenko> Please try

{{#FSNAME}.regrepl("\\$", "")}
Comment by Norbert Püschel [ 2024 Nov 04 ]

I tried that and it did not work.

First, I need to use single quotes for the arguments of regrepl, because this whole construct needs to be used as a user macro context in a trigger prototype, which already uses double quotes.

And exactly the pattern you suggested does not work, even though it should. I used the new tr-Funktion instead, and that somehow works, but does not produce the wanted result if the filesxstem is mounted on a directory instead of a drive letter

If I find the time, I will try again to see wether the problem is with matching the backslash or the $ anchor.

Comment by Alex Kalimulin [ 2024 Nov 04 ]

NPGerman, I've just tested it and it also works in a macro context of a trigger prototype. You need to escape double-quotes used for parameters inside the quoted context:

last(/Test/fsname.item[{#FSNAME}])>{$THRESHOLD:"{{#FSNAME}.regrepl(\"\\$\",\"\")}"}
Comment by Norbert Püschel [ 2024 Nov 05 ]

Thank you, that works. Maybe you should document that specific use case, because quoting it that way is not completely intuitive.

Comment by Alex Kalimulin [ 2024 Nov 07 ]

NPGerman, thanks for the suggestion, please follow ZBX-25519.

Generated at Tue Apr 01 11:12:49 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.