Ad Widget

Collapse

[ZBX 2.2] - Regex, discovery and macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eljibe
    Member
    • Apr 2014
    • 31

    #1

    [ZBX 2.2] - Regex, discovery and macros

    Hi all,

    I'm using a File system discovery rule, on several hosts.
    In the discovery, I specify the filter {#FSNAME} and I want to use a host macro for my regular expression.
    Here is my regular expression:
    Code:
    ^/DB2/MUP10/.*(_data[0-9]*|_tmp|Logiciel|Donnees|arch|log)$
    It works perfectly. Except it only works for one host.
    Some other hosts have exactly the same file system, BUT using the path
    Code:
    ^/DB2/<VARIABLE>/.*(_data[0-9]*|_tmp|Logiciel|Donnees|arch|log)$
    I want to use a macro here and have this regular expression:
    Code:
    ^/DB2/{$MYMACRO}/.*(_data[0-9]*|_tmp|Logiciel|Donnees|arch|log)$
    And filling the value of the macro on each host.
    Is this possible ? So far I have tried and failed.

    Jean-Bernard
Working...