Updated version to 7.0

main
Thomas Trautwein 2024-10-21 12:07:04 +02:00
parent 99fc9545fb
commit c7041d5f32
Signed by: thomas.trautwein
GPG Key ID: AAC146BC6AFAD95B
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"zabbix_export": { "zabbix_export": {
"version": "6.4", "version": "7.0",
"media_types": [ "media_types": [
{ {
"name": "Zabify", "name": "Zabify",
@ -47,7 +47,7 @@
} }
], ],
"script": "try {\n Zabbix.log(4, '[ Zabify ] Starting to send push notification');\n\n var params = JSON.parse(value);\n var payload = {\n \"token\": params.send_to.split(\"===\")[1],\n \"rsaKey\": params.send_to.split(\"===\")[0],\n \"notification\": {\n \"data\": {\n \"host_id\": params.host_id,\n \"event_id\": params.event_id,\n \"severity\": parseInt(params.severity)\n },\n \"message\": { \n \"title\": params.title,\n \"message\": params.message,\n }\n }\n };\n\n Zabbix.log(4, '[ Zabify ] Sending request');\n var request = new HttpRequest();\n request.addHeader('Content-Type: application/json');\n request.setProxy(params.proxy);\n\n var data = JSON.stringify(payload);\n var endpoint = params.protocol + \"://\" + params.fully_qualified_name + \":\" + params.port + \"/send\";\n var response = request.post(endpoint, data);\n if (response === null) {\n throw 'Unknown error. Check debug log for more information.';\n }\n Zabbix.log(4, '[ Zabify ] Received response with status code ' + request.getStatus() + '\\n' + response);\n\n if (request.getStatus() != 200) {\n var parsedResponse;\n try {\n parsedResponse = JSON.parse(response);\n }\n catch (error) {\n Zabbix.log(4, '[ Zabify ] Failed to parse response');\n throw 'Unknown error. Check debug log for more information.';\n }\n\n throw parsedResponse;\n }\n\n Zabbix.log(4, '[ Zabify ] Finished to send push notification without errors');\n return 'OK';\n}\ncatch (error) {\n Zabbix.log(4, '[ Zabify ] Failed to send push notification: ' + error);\n throw 'Zabbix app notification failed: ' + error;\n}", "script": "try {\n Zabbix.log(4, '[ Zabify ] Starting to send push notification');\n\n var params = JSON.parse(value);\n var payload = {\n \"token\": params.send_to.split(\"===\")[1],\n \"rsaKey\": params.send_to.split(\"===\")[0],\n \"notification\": {\n \"data\": {\n \"host_id\": params.host_id,\n \"event_id\": params.event_id,\n \"severity\": parseInt(params.severity)\n },\n \"message\": { \n \"title\": params.title,\n \"message\": params.message,\n }\n }\n };\n\n Zabbix.log(4, '[ Zabify ] Sending request');\n var request = new HttpRequest();\n request.addHeader('Content-Type: application/json');\n request.setProxy(params.proxy);\n\n var data = JSON.stringify(payload);\n var endpoint = params.protocol + \"://\" + params.fully_qualified_name + \":\" + params.port + \"/send\";\n var response = request.post(endpoint, data);\n if (response === null) {\n throw 'Unknown error. Check debug log for more information.';\n }\n Zabbix.log(4, '[ Zabify ] Received response with status code ' + request.getStatus() + '\\n' + response);\n\n if (request.getStatus() != 200) {\n var parsedResponse;\n try {\n parsedResponse = JSON.parse(response);\n }\n catch (error) {\n Zabbix.log(4, '[ Zabify ] Failed to parse response');\n throw 'Unknown error. Check debug log for more information.';\n }\n\n throw parsedResponse;\n }\n\n Zabbix.log(4, '[ Zabify ] Finished to send push notification without errors');\n return 'OK';\n}\ncatch (error) {\n Zabbix.log(4, '[ Zabify ] Failed to send push notification: ' + error);\n throw 'Zabbix app notification failed: ' + error;\n}",
"description": "Please refer to the Zabify integration documentation on https://www.zabify.de/plugin for more information.", "description": "Please refer to the Zabify Server integration documentation on https://www.zabify.de/plugins for more information.",
"message_templates": [ "message_templates": [
{ {
"event_source": "TRIGGERS", "event_source": "TRIGGERS",