[ZBXNEXT-1893] support user macros for "Regexp" field of LLD rule Created: 2013 Sep 09 Updated: 2022 Jan 13 Resolved: 2022 Jan 13 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | 2.0.8 |
Fix Version/s: | None |
Type: | New Feature Request | Priority: | Minor |
Reporter: | Pavel | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 11 |
Labels: | lld, macros, regexps | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | v2.2.1rc1-lld-use-macros.patch |
Description |
Sometimes I need to apply different filters for low-level discovery within the same template. |
Comments |
Comment by Oleksii Zagorskyi [ 2013 Sep 09 ] |
Moved to ZBXNEXT, again. |
Comment by Oleksii Zagorskyi [ 2013 Sep 09 ] |
hmm, currently is possible to redefine on host level the Filter macro and its value for templated LLD rules. or ... you are trying to use the user macro "{$IFNAME_RE}" as a value for the "Regexp" field in a LLD rule settings ? I'm personally not very sure that would need to have such a possibility because as I said already we are allowed to redefine this value for templated rules. |
Comment by Pavel [ 2013 Sep 09 ] |
Usually I can tune and customize templated items/triggers on host level only by macros. |
Comment by Oleksii Zagorskyi [ 2013 Sep 09 ] |
Thanks, then I'm updating the issue summary to reflect exact idea. |
Comment by richlv [ 2013 Sep 09 ] |
sounds potentially useful to me, i'd leave this one open |
Comment by Andrey Melnikov [ 2013 Dec 05 ] |
Simple patch for v2.2 |
Comment by Tatapoum [ 2014 Aug 28 ] |
Hi,
|
Comment by Raymond Kuiper [ 2015 Sep 02 ] |
Needing this also. I'd like to have a generic interface discovery rule in a template and target only the needed interfaces by supplying a macro on the host level. One added request, can we keep the possibility to refer to a global regex from within the macro? That way I can use some globally defined sane defaults. |
Comment by Valeriy Zabawski [ 2017 Sep 29 ] |
Hello. Any updates? |
Comment by Raymond Kuiper [ 2017 Sep 29 ] |
Actually, this already sort of works in Zabbix 3.0.x (and probably above)!! If you define a macro on a template like {$MY_LLD_FILTER} and make it's contents a regexp expression, you can then use that macro in the regexp field of the discovery filters. This allows for overriding the regexp on any l entities that link to this template (hosts and/or higher level templates). What you unfortunately cannot do (AFAIK), is reference a global regexp from the filter, so you are limited to a single line of regexp and cannot do the more fancy things the global regexp logic allows you. For me, this is fine in most cases as I can tune the macro on the hierarchical level where it is needed. |
Comment by Raymond Kuiper [ 2017 Sep 29 ] |
See slide 25 for an example: |
Comment by Alex Kalimulin [ 2022 Jan 13 ] |
Supported since 2.3 (duplicate of |