add: zabbix signal notify script

This commit is contained in:
2023-04-09 11:17:53 +02:00
parent 14895958a9
commit 4cd79a7f9b

View File

@@ -0,0 +1,25 @@
try {
var params = JSON.parse(value);
Zabbix.log(4, '[ Signal Webhook ] Executed with params: ' + params.URL + ', ' + params.Message);
if (!params.URL) {
throw 'Cannot get url';
}
fields = {
message : params.Message,
number : params.number
}
var req = new HttpRequest();
req.addHeader('Content-Type: application/json');
var resp = req.post(params.URL, JSON.stringify(fields))
return 'OK';
}
catch (error) {
Zabbix.log(3, '[ Signal Webhook ] ERROR: ' + error);
throw 'Sending Signal Message failed: ' + error;
}