Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-8489

Add LLD-Macro-postprocessing to LLD-discovery

XMLWordPrintable

      LLD is one of Zabbix most powerful mechanisms. There are a lot of functions and preprocessing options available to use nearly any data format as basis for item discovery and extract relevant parameters as LLD-macros.

      What is missing is an easy way to process the values extracted from the LLD source data before they are assigned to the LLD macros.

      Yes, you have a few options:

      • Use item preprocessing to change LLD macro values working on the whole set of source data before they are taken apart by LLD. This requires at least pretty complicated regex wizardry and might not give you the expected results, as it is pretty difficult to target only specific parameters you wish to change and leave the rest of source data unchanged.
      • You can use macro functions to change the value of LLD macros; however, this has to be put in every location the LLD macro is used instead of making sure it contains the right value in the first place. Also, you might not be able to create the required macro value using regex.

      What I propose is to add an optional post processing chain to LLD macro definitions. It would be easy to adopt a subset of the item preprocessing operations for LLD macros:

      • regex processing
      • replace
      • trimming
      • multiplication
      • number conversions (hex, binary, octal, ...)
      • range validation
      • javascript function

      An use case would be: imagine getting storage sizes reported back in megabytes (or as storage block count). For items, you would use item preprocessing to alway convert them to bytes (to make use of Zabbix's builtin unit processing power). Now you also get another parameter indicating size you want to put in a LLD macro (because it does not normally change). Now imagine you need to build a trigger comparing the processed item values to the threshold stored in the LLD macro... only they are not compatible for comparison, because the macro holds something like "100M" instead of the byte count.

            wiper Andris Zeila
            NPGerman Norbert PĆ¼schel
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: