[ZBXNEXT-242] Support user macros in graph names Created: 2010 Feb 18  Updated: 2023 Nov 17

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F)
Affects Version/s: None
Fix Version/s: None

Type: New Feature Request Priority: Major
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Unresolved Votes: 47
Labels: graphs, macros, patch, usermacros
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

tested on Oracle, maybe for other DBs need correct SQL query.


Attachments: File CMacrosResolver_zabbix3.diff     File CMacrosResolver_zabbix4.diff     File graph-name-macros.diff     File graph-name-macros_fixed.diff     File graph_macros.diff     File macros_graphs.diff    
Issue Links:
Duplicate
is duplicated by ZBXNEXT-893 User macros in graph titles Closed
is duplicated by ZBXNEXT-2767 expand user macros in graph names Open
is duplicated by ZBX-4486 Expanding user macros on graphs Closed
is duplicated by ZBX-8973 Macros do not work Closed
is duplicated by ZBX-17597 You can support me "User macros" for... Closed

 Comments   
Comment by Alexey Pustovalov [ 2010 Feb 24 ]

added support for templated macros

Comment by richlv [ 2010 Feb 24 ]

similar to ZBXNEXT-1

Comment by Alexey Pustovalov [ 2010 Feb 24 ]

now thise patch now executes queries. using API

Comment by richlv [ 2010 Apr 29 ]

similar issues :
ZBX-1538
ZBX-2168
ZBX-2397

ZBXNEXT-205
ZBXNEXT-278

Comment by hamid sfandiari [ 2010 Jul 08 ]

in zabbix 1.8.3 the following differ line is not exist which differ file pointed to them:

– charts.php >> $db_data = reset($db_data);
– charts.php>> $db_graphs = CGraph::get($options);
order_result($db_graphs, 'name');
foreach($db_graphs as $num => $db_graph){

Comment by Jeroen Simonetti [ 2011 Feb 11 ]

New patch for 1.8.4. based on previously attached patch.

Only applying host-level macro's (seems to loop forever if template macros are also checked). Using CGraph API.

Comment by richlv [ 2011 Dec 26 ]

another patch provided in ZBX-4486

Comment by Ian babrou [ 2011 Dec 27 ]

Is there any chance to get it fixed somehow? 3 patches and no progress.

I tried to use common conveniences from zabbix php frontend in my patch, so maybe it looks more organic?

Comment by richlv [ 2011 Dec 27 ]

given how overdue 2.0 is, this one most likely won't be tucked onto it. it will be re-evaluated later

Comment by Vance Turner [ 2012 Jan 05 ]

This is hurting the perception of the product in many areas, and should not be put off.

Comment by Hasitha Lalinda [ 2012 Jul 09 ]

I've created a new patch for version 2. (Attached graph-name-macros_fixed.diff)
This resolves macros in graph names on;

  • Monitoring graphs page.
  • Configuration of graphs page.
  • Favorite graphs section in dashboard.

This patch has been tested with version 2.0.1.

PS: A bug was found in previous diff file graph-name-macros.diff. Fixed version attached: "graph-name-macros_fixed.diff".

Comment by Benjamin Goodrich [ 2013 Feb 15 ]

Is this still currently being planned for inclusion in a future release?

Comment by Eugene [ 2014 Jan 09 ]

User macros are very important for the universalization of the templates. For example, I used the basic template for a variety of devices (routers and switches) through user macros, but the names of the graphs have the same value - port 1, port 2, ... instead Fastethernet or Gigabitethernet depending on the device - this is inconvenient.

Comment by Tomasz Kłoczko [ 2015 Jan 28 ]

I'm looking for updated patch which enables use macros in graphs.
Anyone can share such patch for zabbix 2.2.8?

Comment by Alexander [ 2016 Oct 05 ]

Have a nice day!
What about this features?
This is good idea, very needed for effective use of monitoring nodes with user items names.

Comment by Alexander [ 2016 Oct 06 ]

Hi all!
For example, in zabbix v3 macros support contexts, and this very usable for many sub-items in snmp tree (with Discovery).

In my case Discovery rule configured with:
SNMP OID -> discovery[

{#OID}

,x.x.x]
Items name: {$SLA_NAME.{#SNMPINDEX}}

On the host macros redefined:
{$SLA_NAME:1} -> Tunnel name 1
{$SLA_NAME:2} -> Tunnel name 2

Macros on the host {$SLA_NAME:1} work for Items, Triggers, but not for Graphs names.

Comment by Victor Vislobokov [ 2019 Jan 22 ]

I added support user's macros for Graph names. See patches for zabbix3 and zabbix4.

Unfortunately, I'm not PHP programmer, only sysadmin with a little skill with PHP programming. May be, I mistaken somethere, but it works for my Zabbix installation.

Generated at Thu Mar 28 17:57:42 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.