Ad Widget

Collapse

Q: Using LLD macros in user macro contexts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #1

    Q: Using LLD macros in user macro contexts

    On https://www.zabbix.com/documentation...macro_contexts is possible to find some example about some new possibility of using macros with trigger prototypes.

    However looks like it is missing some small bit in that new feature.
    Simple looks like it is not possible to fill those macros using some initial values.

    To be able use something lie {host:vfs.fs.size[{#FSNAME},pfree].last()}<{$LOW_SPACE_LIMIT:"{#FSNAME}"} initial values of the macros {$LOW_SPACE_LIMIT:"{#FSNAME}"} needs to be present for macros resolver because if not trigger expression will fail because right side of the expression will be empty.
    If lets say input json will have two records with {#FSNAME} "/" and "/home" values it would be good to populate macros like:

    {$LOW_SPACE_LIMIT:"/"}
    {$LOW_SPACE_LIMIT:"/home"}

    out of for example out fixed value or {$LOW_SPACE_LIMIT} macro defined in global or template macros and have possibility to manually tweak values of those macros on each host where template with such LLD with those macros is used.

    So my question is: if I'm wrong and nothing is missing here did someone solved already such initial assignment of those LLD macros on template level and can share some example?

    If it is already some mechanism reading only documentation it is hard to figure out how to effectively use this new feature :/
    I've been thinking that "LLD Macros" tab in LLD definition is about such initial assignment of the macros to fixed vales or other macros but seems it is only about processing input LLD json strings.
    Last edited by kloczek; 07-08-2019, 14:29.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates
Working...