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

Support of JavaScript for global scripts

XMLWordPrintable

    • Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021)
    • 6

      Summary

      Current functionality of global scripts allows execution of shell scripts and IPMI commands only. Nowadays, when most services provide HTTP based APIs it is rather limiting. It would be great if global scripts supported custom logic written in JavaScript with ability to call external HTTP services.

      Acceptance

      1. Zabbix global scripts must be extended to allow execution of pre-defined JavaScript code
        1. A new type "Webhook" must be introduced, it must be implemented similarly to Webhooks used for media types:
          1. JavaScript code must have ability to communicate to external services using HTTP(S) protocol
          2. Parameters must support event related macros
        2. The following parameters must be supported for "Webhook" type of scripts
          1. Parameters: optional list of parameters for JavaScript code (none by default)
          2. Script: JavaScript code
          3. Timeout: maximum allowed script execution time, 30s by default
      2. It must be possible to execute global scripts of type "Webhook" manually from host and event context menus in Zabbix UI (depending on configuration) and also use it in action operations
        1. Zabbix must replace all macros used in parameters with real values before executing JavaScript code

      Use cases

      1. I do not want to rely on external shell scripts for HTTP calls, give me support of JavaScript for global scripts

      Decisions made

      1. Import/export functionality of global scripts is out of scope

        1. screenshot-1.png
          screenshot-1.png
          153 kB
        2. max_confirmation.jpg
          max_confirmation.jpg
          240 kB
        3. TIMEOUT_ERROR.jpg
          TIMEOUT_ERROR.jpg
          168 kB
        4. TIMEOUT_ERROR_AFTER_10s.jpg
          TIMEOUT_ERROR_AFTER_10s.jpg
          128 kB
        5. screenshot-2.png
          screenshot-2.png
          46 kB
        6. screenshot-3.png
          screenshot-3.png
          91 kB
        7. image-2021-01-27-11-51-19-064.png
          image-2021-01-27-11-51-19-064.png
          44 kB
        8. image-2021-01-27-11-55-13-810.png
          image-2021-01-27-11-55-13-810.png
          37 kB

            vmaksimovs Vladimirs Maksimovs
            palivoda Rostislav Palivoda
            Team D
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: