[ZBXNEXT-2338] Allow HOST.* macros to be used in HTTP Proxy for Web scenarios Created: 2014 Jun 10  Updated: 2022 May 03

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Documentation (D), Server (S)
Affects Version/s: 2.2.3
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: Tim Koopman Assignee: Unassigned
Resolution: Unresolved Votes: 6
Labels: httpproxy, macros, webmonitoring
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBXNEXT-3286 {HOST.*} macro resolve in Web scenari... Closed
is duplicated by ZBXNEXT-3361 Web Scenario - Macro for http proxy Closed
is duplicated by ZBX-9568 Webscenario HTTP Proxies in Templates Closed

 Description   

I have create templates for monitoring our proxy servers but found one thing I could not do on the template. I have had to define 2 web scenario's on each host as you cannot use macros like {$HOST.CONN} in the HTTP proxy fields of a template web scenario.
I would like to set it to something like http://{$HOST.CONN}:80

If you add this feature, it would means you can define template web scenarios to test http proxies are actually working. In my case can get a valid page via proxies and get blocked message when trying to access something that should be filtered. I have 12 proxies to monitor so had to create 24 individual web scenarios instead of just 2 if this is available.



 Comments   
Comment by Tim Koopman [ 2014 Jun 10 ]

Had typo above. {$HOST.CONN} should of been

{HOST.CONN1}

.
Also can confirm that global macros and host custom macro work just looks like the standard host ones do not.

For now I am using custom macros added to each host but still would be nice if the standard

{HOST.CONN<1-9>}

macros would also work.

Comment by Oleksii Zagorskyi [ 2014 Jun 10 ]

(1) If it's indeed supported, then this page should be adjusted (footnote #6) :
https://www.zabbix.com/documentation/2.2/manual/appendix/macros/supported_by_location

I mean that support of macros for http proxy is not listed there.

martins-v Added to https://www.zabbix.com/documentation/2.2/manual/appendix/macros/supported_by_location#footnotes. RESOLVED.

zalex_ua I see that 2.4 branch also has been updated. Reviewed, CLOSED.

Comment by Oleksii Zagorskyi [ 2014 Jun 10 ]

Tim, your idea is interesting, but it's definitely not a bug.
Issue moved to ZBXNEXT.

Comment by Marc [ 2015 Jan 30 ]

Why not just using the macro type MACRO_TYPE_HTTPTEST_FIELD instead of MACRO_TYPE_COMMON?

--- src/zabbix_server/httppoller/httptest.c.orig        2015-01-29 10:15:02.119787911 +0100
+++ src/zabbix_server/httppoller/httptest.c     2015-01-29 10:15:55.721793291 +0100
@@ -831,8 +831,8 @@
                }

                httptest.httptest.http_proxy = zbx_strdup(NULL, row[11]);
-               substitute_simple_macros(NULL, NULL, NULL, NULL, &host.hostid, NULL, NULL,
-                               &httptest.httptest.http_proxy, MACRO_TYPE_COMMON, NULL, 0);
+               substitute_simple_macros(NULL, NULL, NULL, NULL, NULL, &host, NULL,
+                               &httptest.httptest.http_proxy, MACRO_TYPE_HTTPTEST_FIELD, NULL, 0);

                httptest.httptest.retries = atoi(row[12]);

Comment by Ender [ 2015 May 19 ]

add Affects Version/s: 2.4.5

Comment by James Cook [ 2022 May 03 ]

Tried adding

{HOST.CONN}

into HTTP Proxy setting for Web Scenario and still see it cant be done in V5.4.X

Generated at Wed Apr 24 15:53:41 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.