[ZBXNEXT-6360] Support of JavaScript for global scripts Created: 2020 Nov 24  Updated: 2024 Apr 10  Resolved: 2021 Feb 14

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: API (A), Frontend (F)
Affects Version/s: None
Fix Version/s: 5.4.0alpha1, 5.4 (plan)

Type: Change Request Priority: Trivial
Reporter: Rostislav Palivoda Assignee: Vladimirs Maksimovs
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: JPEG File TIMEOUT_ERROR.jpg     JPEG File TIMEOUT_ERROR_AFTER_10s.jpg     PNG File image-2021-01-27-11-51-19-064.png     PNG File image-2021-01-27-11-55-13-810.png     JPEG File max_confirmation.jpg     PNG File screenshot-1.png     PNG File screenshot-2.png     PNG File screenshot-3.png    
Issue Links:
Causes
causes ZBX-18916 [Administration - Scripts - Webhook] ... Closed
Sub-task
depends on ZBXNEXT-6143 Increase allowed global script length Closed
part of ZBXNEXT-6368 Move SSH/Telnet/IPMI/Script operation... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
ZBXNEXT-6366 Server changes to support of JavaScri... Specification change (Sub-task) Closed Dmitrijs Goloscapovs  
Team: Team D
Sprint: Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021), Sprint 73 (Feb 2021)
Story Points: 6

 Description   

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


 Comments   
Comment by Vladimirs Maksimovs [ 2020 Dec 23 ]

Implemented in development branch feature/ZBXNEXT-6360-5.3

Comment by Vladimirs Maksimovs [ 2021 Jan 22 ]

Implemented in:

API documentation updated:

Documentation updated:

 

Generated at Tue Apr 29 10:47:39 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.