[ZBXNEXT-3451] Improve nested host group selection Created: 2016 Sep 21 Updated: 2024 Apr 10 Resolved: 2017 Feb 15 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | 3.2.0 |
Fix Version/s: | 3.2.2, 3.4.0alpha1, 3.4 (plan) |
Type: | Change Request | Priority: | Major |
Reporter: | Andris Zeila | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 2 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | h0.conf h2.conf opcommand_configuration.png sorted_dropdown.png unsorted_europe.png unsorted_riga.png zbxnext_3451_testfiles.zip |
Team: | Team A |
Sprint: | Sprint 1 |
Description |
Currently filtering by host group and its nested host groups is possible in frontend by appending /* to the host group. For example if there are groups It's not obvious, is only partially supported by frontend and not supported by server at all. To improve it frontend and server should automatically assume that all nested groups are included if simply the top group name is given (server in the above example). |
Comments |
Comment by Aleksandrs Saveljevs [ 2016 Sep 26 ] |
After the current behavior is redesigned, documentation may need to be updated - see |
Comment by Andris Zeila [ 2016 Sep 27 ] |
Server side done in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-3451 However frontend specification is not complete, so its probably early for testing. |
Comment by Oleg Egorov (Inactive) [ 2016 Oct 04 ] |
Frontend side ready to testing |
Comment by Oleg Egorov (Inactive) [ 2016 Oct 04 ] |
(1) [F] Changed translation strings: Strings added:
gunarspujats CLOSED |
Comment by Gunars Pujats (Inactive) [ 2016 Oct 06 ] |
(2) [F] PHPUnit test CHostGroupNameValidatorTest fails oleg.egorov RESOLVED in r63034 gunarspujats CLOSED |
Comment by Gunars Pujats (Inactive) [ 2016 Oct 06 ] |
(3) [F] Page filter in hostinventoriesoverview.php doesn't select subgroups oleg.egorov RESOLVED in r63034 gunarspujats CLOSED |
Comment by Gunars Pujats (Inactive) [ 2016 Oct 06 ] |
(4) [F] Multiselect parameter "subgroupids" is not needed anymore: oleg.egorov RESOLVED in r63037 gunarspujats CLOSED |
Comment by Gunars Pujats (Inactive) [ 2016 Oct 06 ] |
(5) [F] Coding style
oleg.egorov RESOLVED in r63035 gunarspujats CLOSED |
Comment by Gunars Pujats (Inactive) [ 2016 Oct 07 ] |
Frontend tested. |
Comment by Andris Zeila [ 2016 Oct 07 ] |
Server side yet to be tested. |
Comment by Natalja Romancaka [ 2016 Oct 12 ] |
(6) [F] filter on page "Monitoring->Web" and "Reports->Availability report" does not select subgroups oleg.egorov Fixed in r63142 and r63403
oleg.egorov RESOLVED in r63795 gunarspujats CLOSED |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 14 ] |
(7) [D] From https://www.zabbix.com/documentation/3.4/manual/config/hosts/host#configuring_a_host_group .
Ok, got that.
Yes, you can, but you won't be able to filter by Europe or Europe/Latvia in this case. For that you have to create these host groups. martins-v This seems only partially true. In global search and in some filters it is possible to search by any string. In multiselect fields yes, only existing groups can be used. sandis.neilands Exactly. While "orphan" child groups are allowed it's hard to conceive a use case other than allowing creating child groups before creating the corresponding parent groups. What I wanted to clarify here was that Zabbix will not automatically create or update parent groups for the user. The user has to do it manually. Currently the documentation hints otherwise. martins-v RESOLVED for 3.2, 3.4. Please review. sandis.neilands Looks fine. Just noticed another detail that has changed - asterisks are now allowed. martins-v Thanks, updated that part as well. sandis.neilands Looks good, CLOSED. |
Comment by Natalja Romancaka [ 2016 Oct 17 ] |
(8) [F] selected "Host group" not include the nested host groups in global scripts oleg.egorov Not related to the main issue, but can be discussed natalja.zabbix Now all global scripts available to all host groups, even if selected certain host group for script oleg.egorov RESOLVED in r63422
oleg.egorov Moved to |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 18 ] |
(9) [D] Consider the following setup. Host groups: a/b/c a/b a Hosts: host_0 in a/b/c host_1 in a/b Scenario: filter by a/b. Result: both host_1 of a/b and host_0 of a/b/c are returned. This has implications on host group hierarchy design. martins-v Discussed with sandis.neilands. Decided that this information is best suited for a how-to style documentation. For now, WON' T FIX. |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 19 ] |
(10) [D] (and [F]?) Take a look at the screenshot opcommand_configuration.png. What is the meaning of "Execute on" option for each target type: current host, host, host group. martins-v There is more detail now for these options in documentation. Please review. RESOLVED sandis.neilands Thanks! CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 21 ] |
(11) [S] [F] Upgrade will break action conditions. Before this feature condition host group == a filtered out the hosts that are in a itself but are not in a/b, a/b/c, etc. After this feature the same condition will include all hosts of a and also its subhostgroups. The way to get only the a's hosts is this: host group == a and host group <> a/b and host group <> a/another_subgroup and ... e.g. set substraction: a - a's subgroups. The problem with this approach is that each time a subgroup is added all expresions filtering for just the a's hosts must be updated. We could resolve this by introducing new operators for host group conditions. Perhaps "in" and "not in"? The same applies to 'Host group' target of remote command action operations, and other places. wiper We are not currently adding new operations and the new behaviour is documented:
CLOSED |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 21 ] |
(12) host_group host ---------------------------------------------- a h2 a/b0 h0
# /tmp/h0.log 7860:20161021:194406.325 Executing command 'logger problem' 7858:20161021:194406.333 Executing command 'logger problem' 7859:20161021:194421.424 Executing command 'logger recovery' 7860:20161021:194421.433 Executing command 'logger recovery' # /tmp/h2.log 7946:20161021:194406.341 Executing command 'logger problem' 7945:20161021:194421.441 Executing command 'logger recovery' sandis.neilands WONTFIX. Configuration error on my part - another host was "hiding" from me in the filter. |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 31 ] |
(13) [D] Describe semantics of:
martins-v Added to documentation (see 'Target list'). RESOLVED sandis.neilands Thanks! CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Oct 31 ] |
(14) [D] For discussion. Remote commands can be executed on hosts that are in "no data collection" maintenance. Scenario: trigger action on host h0. Action operation: remote command on host h1 (which is in maintenance). Expected: remote command is not run on h1. Actual: remote command is run on h1 possibly interfering with maintenance work being done on the host. sandis.neilands Discussed with sasha, decided to document it for now. martins-v Added to the remote command page. RESOLVED sandis.neilands CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 01 ] |
(15) [F] In multi-select forms suggested host groups are not sorted in lexicographic order. Instead they are sorted by host group ID (group creation order).
See the attached screenshots unsorted_europe.png, unsorted_riga.png, sorted_dropdown.png oleg.egorov RESOLVED in r63515 gunarspujats Broken creating/editing of map elements: oleg.egorov RESOLVED in r63624 and r63636 gunarspujats CLOSED |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 01 ] |
(16) [F] Items for child groups are not shown in "Latest data". Problems of child host groups are not shown in "Problems" view. Possibly other filters are not working as expected as well. Example.
If it is left as-is then filtering in Monitoring and Configuration pages differs - which is misleading. In Monitoring pages - child host groups are not included, in Configuration - they are included. oleg.egorov Fixed only "Latest data" in r63530, other parts will be fixed under other ZBXNEXT gunarspujats When multiple groups are selected, then hosts from child groups are not shown. natalja.zabbix When selected only hosts in filter: Undefined variable: groupids [ in latest.php:152] oleg.egorov RESOLVED in r63801 gunarspujats CLOSED |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 02 ] |
(17) [S] Should aggregated items become unsupported if non-existent host groups are specified? See aggregate_get_items() /* TODO: make item notsupported when zbx_dc_get_nested_hostgroupids_by_names() fails */ wiper Aggregate checks must become unsupported only if there are no matching items in the specified groups. If one of groups are invalid, but other groups have matching items, then the aggregate value is still calculated based on the valid groups. sandis.neilands CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 02 ] |
(18) [S] Memory leak in DCsync_hostgroups(). Memory for the nested_groupids is not freed when host group is deleted. We might also want to release the memory (reserve 0) in places where we call zbx_vector_uint64_clear() for the nested_groupids as otherwise we hold memory for the maximum amount of child host groups that the parent host group had during the lifetime of server process. To users this might look like a leak. wiper RESOLVED in r63504 sandis.neilands CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 02 ] |
(19) [S] Maintenance for a single host (e.g. no host groups) causes failed SQL query every minute during maintenance.
See process_maintenance_hosts(). Same problem for host-only remote commands (execute_commands()).
wiper RESOLVED in r63505 sandis.neilands CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 02 ] |
(20) [S] Similarly to (17), (19) if there is a configuration sync just before call to zbx_dc_get_nested_hostgroupids() and the relevant host group is removed in that sync, then zbx_dc_get_nested_hostgroupids will find nothing and the SQL queries will be incorrect. Solutions:
wiper Opted for (2) - less cluttered code over performance gains in low probability situations. sandis.neilands CLOSED, added comment in r63712. wiper reviewed, thanks |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 02 ] |
(21) [S] Double check the header comments to the modified functions - they should mention that child host groups will be included as well. Also in escalator.c change copy-paste comments from maintenance to operations. wiper RESOLVED in r63506 sandis.neilands CLOSED with another small change in r63508. wiper reviewed, thanks |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 02 ] |
Tested nested host group:
|
Comment by Andris Zeila [ 2016 Nov 03 ] |
(22) [F] When selecting hosts to be added to maintenance the Group combobox filter does not include hosts from nested groups. oleg.egorov Moved to |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 10 ] |
(23) [D] Documentation for (17) - aggregated item becomes not supported when no item can be included (due to incorrect item key, or no such item in any of the specified (possibly incorrect) host groups. E.g. the aggregated item becomes not supported also if all of the specified host groups are incorrect. martins-v RESOLVED. See description for cases when aggregate items turn unsupported. sandis.neilands CLOSED. |
Comment by Sandis Neilands (Inactive) [ 2016 Nov 10 ] |
(24) [S] [D] Double quoting of groups when aggregated item becomes unsupported. Similarly, if there are no groups specified in the key then we could give a more specific error. key: grpsum[["a/b1111", "aaaaaa"],"dummy_item_1",last] log: 24968:20161110:160425.018 item "dummy_aggregator:grpsum[["a/b1111", "aaaaaa"],"dummy_item_1",last]" became not supported: No items for key "dummy_item_1" in group(s) ""a/b1111","aaaaaa"". info in frontend: No items for key "dummy_item_1" in group(s) ""a/b1111","aaaaaa"". When quotes are removed from key... key: grpsum[[a/b1111, aaaaaa],"dummy_item_1",last] log: 24965:20161110:160754.419 error reason for "dummy_aggregator:grpsum[[a/b1111, aaaaaa],"dummy_item_1",last]" changed: No items for key "dummy_item_1" in group(s) "a/b1111,aaaaaa". info in frontend: No items for key "dummy_item_1" in group(s) "a/b1111,aaaaaa". wiper Opted for quoting individual groups in the list: -> "" "" -> "" a -> "a" "a" -> "a" a,b -> "a", "b" "a","b" -> "a", "b" "a",b,"c" -> "a", "b", "c" Added specific error message if no groups are found, but did not make separate error message for empty groups list. RESOLVED in r63711 sandis.neilands The info message for the unsupported item in case all specified groups are incorrect is now as follows. No groups in list "aaaaa", "bbbbb", "ccccc". Let's revisit it to use the same vocabulary as the docs after martins-v updates the relevant page. martins-v Possibly, "None of the groups in list "..." is correct" sandis.neilands wiper, please change the error message to the one suggested by martins-v above. |
Comment by Kenneth Palmertree [ 2016 Nov 15 ] |
Also I am seeing an issue with nested host groups with spaces in the name before and after '/' when trying to add permission in user groups. For example: If you try and add "QA / ENV / *" you get no selection not found do to the spaces before and after the '/'. |
Comment by Oleg Egorov (Inactive) [ 2016 Nov 22 ] |
Implemented in:
|
Comment by Sandis Neilands (Inactive) [ 2016 Nov 23 ] |
(25) [S] Two new Coverity issues: CID 154518 and CID 154517. ** CID 154518: API usage errors (SWAPPED_ARGUMENTS) ________________________________________________________________________________________________________ *** CID 154518: API usage errors (SWAPPED_ARGUMENTS) /src/zabbix_server/poller/checks_aggregate.c: 352 in aggregate_get_items() 346 ret = SUCCEED; 347 348 out: 349 if (FAIL == ret) 350 { 351 aggregate_quote_groups(error, &error_offset, &error_alloc, groups); >>> CID 154518: API usage errors (SWAPPED_ARGUMENTS) >>> The positions of arguments in the call to "zbx_chrcpy_alloc" do not match the ordering of the parameters: * "&error_offset" is passed to "alloc_len" * "&error_alloc" is passed to "offset" 352 zbx_chrcpy_alloc(error, &error_offset, &error_alloc, '.'); 353 } 354 355 zbx_vector_uint64_destroy(&groupids); 356 357 zabbix_log(LOG_LEVEL_DEBUG, "End of %s()", __function_name); ** CID 154517: Error handling issues (CHECKED_RETURN) /src/zabbix_server/poller/checks_aggregate.c: 250 in aggregate_quote_groups() ________________________________________________________________________________________________________ *** CID 154517: Error handling issues (CHECKED_RETURN) /src/zabbix_server/poller/checks_aggregate.c: 250 in aggregate_quote_groups() 244 if (NULL == (group = get_param_dyn(groups, i))) 245 continue; 246 247 zbx_strcpy_alloc(str, str_alloc, str_offset, separator); 248 separator = ", "; 249 >>> CID 154517: Error handling issues (CHECKED_RETURN) >>> Calling "quote_key_param" without checking return value (as is done elsewhere 5 out of 6 times). 250 quote_key_param(&group, 1); 251 zbx_strcpy_alloc(str, str_alloc, str_offset, group); 252 zbx_free(group); 253 } 254 } 255 wiper RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-3451_2 sandis.neilands CLOSED, thanks! wiper Added specific quoting function to quote also groups ending with '\'. In theory this function could be used by quote_key_param() and zbx_get_escape_string_len() functions, but decided against changing existing code in 3.2. sandis.neilands CLOSED. |
Comment by Andris Zeila [ 2016 Nov 24 ] |
Latest changes released in:
|
Comment by Martins Valkovskis [ 2016 Dec 06 ] |
(26) Updated documentation:
sandis.neilands This functionality requires configuration changes when upgrading to 3.2.2 and 3.4 (see (11)). How about adding this also to the upgrade notes? martins-v I agree. Please review the upgrade note entry: RESOLVED sandis.neilands Thank you, CLOSED. |
Comment by Marcel Jäpel [ 2016 Dec 08 ] |
Should there any nested group support in API, too? I tried with v3.2.2 the following scenario There is one host with an active trigger in group1/subgroup1. If I call event.get via API and search in group id 19 than I get the event for the active trigger. But if I search for group id 18 than there are no events. sandis.neilands To my knowledge this is not implemented. What you can do is search for all subgroups with hostgroup.get and then call event.get for each found group. { "jsonrpc": "2.0", "id": %d, "auth": "%s", "method": "hostgroup.get", "params": { "output": [ "groupid", "name" ], "search": { "name": [ %s ] } } |
Comment by Sandis Neilands (Inactive) [ 2016 Dec 08 ] |
(27) [A] [D] API changes are not documented. At least these pages should be updated.
oleg.egorov No API changes. CLOSED |