说明:此配置仅适用于7版本及以上,低版本可能有问题

JavaScript 内容如下:
try {
var sourceData = JSON.parse(value),
req = new HttpRequest(),
response;
if (sourceData.HTTPProxy) {
req.setProxy(sourceData.HTTPProxy);
}
req.addHeader('Content-Type: application/json');
var targetData = {
"msg_type": "text",
"content": {
"text": sourceData.message
}
};
Zabbix.log(4, '[feishu webhook ] Webhook request with value=' + value);
response = req.post(sourceData.URL, JSON.stringify(targetData));
Zabbix.log(4, '[feishu webhook ] Responded with code: ' + req.getStatus() + '. Response: ' + response);
try {
response = JSON.parse(response);
}
catch (error) {
if (req.getStatus() < 200 || req.getStatus() >= 300) {
throw 'Request failed with status code ' + req.getStatus();
}
else {
throw 'Request success, but response parsing failed.';
}
}
if (req.getStatus() !== 200 || response.code !== 0) {
throw response.error;
}
return 'OK';
}
catch (error) {
Zabbix.log(3, '[ Jira webhook ] Sending failed. Error: ' + error);
throw 'Failed with error: ' + error;
}








![[原创][6]探究C#多线程开发细节-“ConcurrentDictionary<T,T>解决多线程的无顺序性的问题“](https://img-blog.csdnimg.cn/direct/6c82d2c3cf914c4c81003f29b93ac9b8.gif)










