[ZBXNEXT-210] "resolve" user macro functionality Created: 2010 Jan 26 Updated: 2015 Sep 11 Resolved: 2015 Sep 11 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Frontend (F) |
Affects Version/s: | None |
Fix Version/s: | 2.5.0 |
Type: | New Feature Request | Priority: | Major |
Reporter: | richlv | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 18 |
Labels: | macros, patch, unsquashable, usability, usermacros | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | ZBXNEXT-210-2.0.9-1.patch ZBXNEXT-210-2.0.9-1.png ZBXNEXT-210-2.0.9-2.png ZBXNEXT-210-2.0.9-4.patch ZBXNEXT-210-2.0.9-4.png ZBXNEXT-210-2.0.9-5.patch ZBXNEXT-210-2.0.9.png ZBXNEXT-210_2.2.1-example.png ZBXNEXT-210_show_all_macro_values-2.2.1.patch ZBXNEXT-210_show_all_macro_values-2.4.2.patch macro_resolving.png macro_resolving_2.png zbxNext210-2.2.5-2.patch zbxNext210-2.2.5.patch | ||||||||||||||||||||||||
Issue Links: |
|
Description |
currently there is no easy way to determine what a user macro will resolve to. this requires checking three locations if looking at a host linked to a single template (global, template, host), but if nested templates are used, this becomes a hard task. a macro resolution feature would help. probably available on a host/template level, it would show value macro would have and where the value originates. |
Comments |
Comment by Marc [ 2013 Jul 19 ] |
Why not adding a new tab beside the existing 'Macros' tab in 'CONFIGURATION OF TEMPLATES' and 'CONFIGURATION OF HOSTS'? |
Comment by richlv [ 2013 Jul 20 ] |
i believe that could fit quite well even in the existing macro tab - just show all macros that affect current host/template, and where they come from |
Comment by Marc [ 2013 Jul 20 ] |
That was my first intention too. But for cases where a lot user macros are inherited I thought it could become uncomfortable to manage the individual ones. If implemented in the existing tab, then I would appreciate having the ability to toggle between 'All' and 'Current Host/Template'. |
Comment by Oleksii Zagorskyi [ 2013 Jul 20 ] |
Mark, about the "All" (you mentioned in previous comment) - remember that not superadmins do not have access to global macros. |
Comment by Marc [ 2013 Jul 20 ] |
Yes I do. The "All" was meant in read-only context. |
Comment by Oleksii Zagorskyi [ 2013 Jul 20 ] |
But not superadmins should not know any global macros value. |
Comment by richlv [ 2013 Jul 20 ] |
i think we can safely allow anybody (at least with admin privs) to know all global macros. |
Comment by Marc [ 2013 Jul 20 ] |
Oleksiy, I see. But if this is desired, what I appreciate, then this should be solved by design and not by hiding. Maybe by a flag on (global) user macro level that does not allow value evaluation at any site. But that would lead more to a re-design of macro evaluation similar to |
Comment by Jens Berthold [ 2013 Oct 29 ] |
I think the information is already very good, but should not all be visible (page looks overloaded). Then e.g. in a popup the detailed information about the macro "value hierarchy" could be shown. |
Comment by Marc [ 2013 Oct 29 ] |
I had similar thoughts. But instead of using a popup menu I thought about hiding them in a way it is done for ZBXNEXT-1796 |
Comment by Marc [ 2013 Oct 30 ] |
Without the 'Template name' heading it looks much better to me. |
Comment by Marc [ 2013 Nov 03 ] |
Attached patch: separates the regular macro view and the resolved user macro view. |
Comment by Marc [ 2013 Nov 03 ] |
Attached patch: displays hyperlinks for every template name. |
Comment by Jens Berthold [ 2013 Nov 04 ] |
Separating the views using different tabs sounds reasonable. But I still think the most often needed information when administrating Zabbix is: macro name and macro value. (Zabbix' one big drawback is IMHO the lack of intuitive GUI elements, so when introducing new features I thinks it's a good thing to bear intuitivity and efficient use in mind) |
Comment by John Hayes [ 2013 Nov 30 ] |
I like some of the suggested implementations above. I'm not sure if separate tabs is needed (though it probably doesn't do any harm), for me the important feature is to see which macros currently apply to the host, regardless of where they are from. |
Comment by Corey Shaw [ 2013 Dec 10 ] |
Attached a port of this patch to 2.2.1. It is mostly the same as the 2.0.9-1.png example, but it contains some elements from the 2.0.9-5 patch. |
Comment by Corey Shaw [ 2013 Dec 10 ] |
I re-attached a new screenshot and patch with slightly larger text boxes. |
Comment by Corey Shaw [ 2014 Jan 30 ] |
Attached a new version of the 2.2.1 patch. It fixed a minor error that only showed up when creating a new host (it was a benign error). |
Comment by Pavels Jelisejevs (Inactive) [ 2014 Jan 31 ] |
Corey, I've quickly tested the 2.2.1 patch. It doesn't seem to work for templates. A lot of undefined indexes are displayed in the configuration form and it doesn't display any inherited macros. Regarding the idea as a whole: I like the idea of displaying macros, inherited from the linked templates. But I'm not sure that we should display global macros. Some users have installations with a lot of global macros, most of which will be irrelevant for the current host. The user will then be forced to find his way through tens or even hundreds of global macros that he doesn't need. |
Comment by Corey Shaw [ 2014 Jan 31 ] |
Pavels - Thanks for the feedback. I'll certainly take a look at fixing those template errors that show up. As for the global macros, that's a very good point. |
Comment by Corey Shaw [ 2014 Jan 31 ] |
Added a slightly modified patch to fix the index error when editing templates. Please note, this page still doesn't have inherited macros show up when editing templates. I'm not sure why yet. |
Comment by Corey Shaw [ 2014 Feb 07 ] |
I have attached another fixed version of the patch that now works properly for templates as well. Also, as requested, I removed global macros from being shown on the pages. The relevant code is simply commented out, so it would be easy to add in the future if required. |
Comment by Marc [ 2014 Apr 07 ] |
jelisejev, I thought about your comment for awhile. Anyhow, to me efficiency beats nice look. Having a separate tab to optionally show all macros sounds sufficient to me. Even when there are hundreds or thousands of user macros at host level (btw, I expect to have hundreds globals), then there has to be a way to see them all. |
Comment by Jamshid Damanpour [ 2014 Apr 17 ] |
1. Is it possible to add update the triggers page so that macros are displayed similar to ZBXNEXT-210_2.2.1-example.png? 2. Is it possible to toggle evaluation of macros in trigger expressions so that we can switch between {cpu.last(#1)}>85 and {cpu.last(#1)}>{$CPU_TOTAL}? |
Comment by Marc [ 2014 Aug 16 ] |
Attached patch zbxNext210-2.2.5.patch ports ZBXNEXT-210-2.0.9-5.patch to release 2.2.5 as seen here (e.g. incl. radio buttons): |
Comment by Tatapoum [ 2014 Aug 19 ] |
Thank you for this great patch Marc. |
Comment by Marc [ 2014 Aug 19 ] |
Attached patch zbxNext210-2.2.5-2.patch fixes the inability of un-linking a template when editing a host. |
Comment by Marc [ 2014 Aug 19 ] |
tatapoum, my pleasure! See discussion starting at: https://support.zabbix.com/browse/ZBXNEXT-210?focusedCommentId=84601 Any Any information disclosed by this patch is get by using the API with the respective user (privileges). |
Comment by Oleksii Zagorskyi [ 2014 Aug 19 ] |
Also note that starting from 2.4 global macro may be (I didn't test it from permission point of view) accessed for notifications - |
Comment by richlv [ 2014 Sep 30 ] |
attached patches seem to use red colour or strikeout to identify macros that are overridden on host/template, but they use "-" to identify undefined macro. |
Comment by Corey Shaw [ 2014 Nov 12 ] |
Ported the latest patch from Marc to 2.4.2. I have also updated the patch to use an italicized "Undefined" for values that haven't been set as richlv suggested. I'm not sure if my method for doing that is correct, but it appears to work.... I should also mention that I found a strange bug with Firefox v31. When doing a page refresh on a host configuration page, the "Macros" tab will remember the last "type" of macros that you looked at (host/inherited). If the last "type" that you looked at was "inherited" it will have that button highlighted, but still show the host macros (not inherited ones). Clicking on either of the buttons will cause the page to start working properly again. I could not duplicate this in Chrome. |
Comment by Jens Berthold [ 2015 Mar 24 ] |
I'd like to discuss another idea: |
Comment by richlv [ 2015 Mar 24 ] |
jens, sounds like a good idea, but usermacros can be used also in triggers, lld rules, webscenarios... we would have to parse a large amount of places to see whether a macro is used or not. and then users would likely want to know at least the type of entity that uses those macros it seems to me that it might be better submitted as a separate feature request, unless developers decide to include it in this issue |
Comment by Alexander Vladishev [ 2015 Apr 07 ] |
The prototype is available in the development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-210. |
Comment by richlv [ 2015 Apr 07 ] |
this implementation looks nice functionally, thanks
|
Comment by Alexander Vladishev [ 2015 Apr 08 ] |
richlv, thanks for the remarks! It will be discussed together with a specification. |
Comment by Alexander Vladishev [ 2015 Apr 08 ] |
The prototype has been updated in r53011. richlv, please take a look. |
Comment by richlv [ 2015 Apr 09 ] |
(1) it would be nice to link to global macro config here. making the header clickable could be confusing, as it could imply sorting. how about placing the link in the parenthesis ? so the header would be (italicised text would be a link) : sasha RESOLVED in r53329:53330,53335. iivs CLOSED. |
Comment by richlv [ 2015 Apr 09 ] |
(2) clicking on the template name currently opens general template properties - focus on the macros tab would be better, but there does not seem to be a decent solution for that at this time sasha It is too hard to implement now. WON'T FIX |
Comment by richlv [ 2015 Apr 09 ] |
(3) it would be nice to filter provided upstream macros by template, but that has been decided to be out of scope at this time sasha Out of scope. WON'T FIX |
Comment by richlv [ 2015 Apr 09 ] |
(4) having higher level to the right is the opposite of "parent..." line in templated items, triggers etc - seems to have a slight potential for confusion. an idea for the field ordering (based on the initial design) : it would keep control links (change/remove) on the right hand side. issues raised :
the first one is a bit less of a concern with the macro name being between host and upstream values. as for column moving, switching between the modes takes some 5 seconds, so i don't really notice that and based on the new design : sasha After discussion, decided to stay on the first design because it has less issues described above. WON"T FIX |
Comment by Marc [ 2015 Apr 10 ] |
richlv, your last/new design proposal looks very reasonable to me. The layout is clean and more intuitive. Although I'm a bit uncertain regarding the Global/Template value visualization. Another thing that I have in mind, but that's probably a more general issue, is a refactoring the object used to fill the tabs. |
Comment by Alexander Vladishev [ 2015 Apr 23 ] |
Available in the development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-210 |
Comment by Ivo Kurzemnieks [ 2015 Apr 30 ] |
(5) String changes? Removed strings:
New strings:
sasha RESOLVED iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 Apr 30 ] |
(6) Administration > General > Macros Suppose we have 9 macros in the list. "Remove" action contains indexes 0 to 8. Pressing "Add" will insert a blank field with index 9. Type in a macro and press "Update". Now the list contains 10 macros, but "Remove" action contains IDs 32,33,20,21, etc. Press "Add" again and see that the next number is lower than current ID and it is now 10. When we remove blank fields several times and press "Add" several times, we come to the point that new blank field will have same index that some existing macro ID. This will result in many different problems like:
In addition to that if I update without changes, nothing is displayed. Suppose that is OK for a change and actually nothing is updated. But adding a blank field at the end and updating the list does not remove the empty field. Previously empty field was removed at all times. Add as many empty fields as you want, now they will stay on page. sasha RESOLVED in r53499. iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 Apr 30 ] |
(7) Configuration > Hosts > Macros > Inherited and host macros
sasha RESOLVEd in r53494.
sasha Dropped support of placeholders in IE8 and IE9. RESOLVED in r53496.
sasha RESOLVED in r53493.
sasha RESOLVED in r53494.
sasha Already was discussed long time ago. WON'T FIX iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 Apr 30 ] |
(8) Administration > Audit log
sasha That is out of scope for this issue. I didn't change any audit log strings. WON'T FIX
sasha RESOLVED in r53489. iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 May 05 ] |
(9) Configuration > Hosts > Host prototypes sasha RESOLVED in r53486. iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 May 06 ] |
(10) Open LLD created host in edit form, go to "Macros" tab click "Inherited and host macros" button. Now press "Full clone". Page is reloaded with large empty form and no tabs. sasha RESOLVED in r53500. iivs If a host prototype had linked templates, and we open LLD created host in edit form, then "Macros" tab and then click on "Inherited and host macros", we don't see any inherited macros and when we switch back to "Templates" tab, the list is now empty. REOPENED. sasha RESOLVED in r53502. iivs Still some problems with those hosts. Full clone a LLD created host, change name, change visible name, change some groups, change some interfaces, change proxy, change data in IPMI tab and swich to different host inventory mode. Go to "Macros" and "Inherited host macros". It may look OK, but user doesn't know that almost all fields have been reset. The only information that was remebered, was checkbox and description. Another thing is that when I try to add a template, it reloads page, but it does not add it, nor I can remove a template. REOPENED. sasha RESOLVED in r53587. iivs Now all interfaces cannot be dragged when cloning or full cloning a discovered host REOPENED. sasha RESOLVED in r53621. iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 May 07 ] |
(11) Delete all global macros, open host create form, click "Macros" > "Inherited and host macros" sasha RESOLVED in r53503. iivs CLOSED. |
Comment by Ivo Kurzemnieks [ 2015 May 11 ] |
(12) Coding style and various improvements.
sasha RESOLVED in r53572. (except host_prototypes:295 - 'hostmacroid' is not needed here) iivs I added one missed constant in r53601; slightly improved js code in r53604 and removed some comments in r53607 sasha Thanks! CLOSED |
Comment by Ivo Kurzemnieks [ 2015 May 15 ] |
TESTED |
Comment by Alexander Vladishev [ 2015 May 15 ] |
Available in pre-2.5.0 r53633. |
Comment by Alexander Vladishev [ 2015 May 15 ] |
(13) Documentation martins-v Updated documentation:
RESOLVED. sasha Thanks! CLOSED sasha REOPENED, martins-v, please add screenshot of the macros in Configuring a template martins-v RESOLVED. sasha Thanks! CLOSED |
Comment by Martins Valkovskis [ 2015 Jul 30 ] |
(14) In template properties these two strings seem potentially misleading: "Host macros" and "Inherited and host macros" It seems like "Template macros" and "Inherited and template macros" would be much better. gunarspujats Added translation strings: gunarspujats RESOLVED in r55067. sasha CLOSED Please take a look at my changes in r55191,55192. gunarspujats CLOSED gunarspujats Available in pre-2.5.1 (trunk) r55239. |