[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: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Epic Name: | Macro Functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Team: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
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: |
Comment by Norbert Püschel [ 2024 Nov 02 ] |
I fail to see how this - really nice improvement - fixes my problem described in I tried using regrepl to remove the trailing slash from {#FSNAME} for Windows-VMs, but I failed. Please explain.
{{#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 |