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

Using built-in macros in JavaScript and regular expression preprocessing

XMLWordPrintable

      Hi,
      Could you please make the built-in macros available for use in preprocessing steps ?

      For example, it would be nice to use {HOST.HOST} in regular expression preprocessing,
      but it would be nice if I could use it also in JavaScript preprocessing calling
      a method of a class ZabbixMacro like the following:

      var hostname = ZabbixMacro.get("{HOST.HOST}");

      One use case where I encountered this limitation is the following:
      I'd like to use Javascript preprocessing to do some GET requests to an API.
      This API has the same domain name as the hostname configured on Zabbix,
      so I'd like to be able to do a CurlHttpRequest.Get() to it using the value
      of the {HOST.HOST} macro.
      I'm aware that this macro can be used in the URL field of the HTTP Agent check Item, but going through this path will force me to create a ton of other items in order to achieve my goal, it would be definitely cleaner to throw everything inside a Javascript preprocessing step.

            zabbix.support Zabbix Support Team
            stefano.mendola Stefano Enrico Mendola
            Votes:
            36 Vote for this issue
            Watchers:
            30 Start watching this issue

              Created:
              Updated: