From fb51354649e8eef5766f3963e18855f1d5017159 Mon Sep 17 00:00:00 2001 From: Mark Oudsen Date: Fri, 12 Mar 2021 16:33:44 +0100 Subject: [PATCH] Added ability to configure HTTP proxy (v1.24) --- config/config.json.template | 1 + config/config.json.template.multigraph | 1 + javascript/zabbix.mailGraph.js | 5 ++++- mailGraph.xml | 9 ++++++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/config.json.template b/config/config.json.template index 8e3dcfc..4b20258 100644 --- a/config/config.json.template +++ b/config/config.json.template @@ -11,6 +11,7 @@ "cli_period": "30m", "cli_period_header": "Last 30 minutes", "cli_debug": 1, + "cli_proxy": "", "zabbix_user": "alogicalusername", "zabbix_user_pwd": "astrongpassword", "zabbix_api_user": "alogicalusername", diff --git a/config/config.json.template.multigraph b/config/config.json.template.multigraph index 441233d..eb5ef90 100644 --- a/config/config.json.template.multigraph +++ b/config/config.json.template.multigraph @@ -11,6 +11,7 @@ "cli_periods": "10m,4h,2d,7d", "cli_periods_headers": "Last 10 minutes,Last 4 hours,Last 2 days,Last 7 days", "cli_debug": 1, + "cli_proxy": "", "zabbix_user": "alogicalusername", "zabbix_user_pwd": "astrongpassword", "zabbix_api_user": "alogicalusername", diff --git a/javascript/zabbix.mailGraph.js b/javascript/zabbix.mailGraph.js index feb4527..fdc75bf 100644 --- a/javascript/zabbix.mailGraph.js +++ b/javascript/zabbix.mailGraph.js @@ -7,7 +7,10 @@ try { result = { tags: {} }; // Set HTTP proxy if required - if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { req.setProxy(params.HTTPProxy); } + if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { + req.setProxy(params.HTTPProxy); + fields.HTTPProxy = params.HTTPProxy; + } // Declare output type req.AddHeader('Content-Type: application/json'); diff --git a/mailGraph.xml b/mailGraph.xml index d8be653..c1fff2d 100755 --- a/mailGraph.xml +++ b/mailGraph.xml @@ -1,7 +1,7 @@ 5.0 - 2021-03-10T18:50:24Z + 2021-03-12T15:29:06Z MailGraph @@ -77,7 +77,10 @@ result = { tags: {} }; // Set HTTP proxy if required - if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { req.setProxy(params.HTTPProxy); } + if (typeof params.HTTPProxy === 'string' && params.HTTPProxy.trim() !== '') { + req.setProxy(params.HTTPProxy); + fields.HTTPProxy = params.HTTPProxy; + } // Declare output type req.AddHeader('Content-Type: application/json'); @@ -188,4 +191,4 @@ itemId: {ITEM.ID] - + \ No newline at end of file