[ZBXNEXT-3206] Add support for flexible item key parameters for Alias in agent configuration file Created: 2016 Mar 21  Updated: 2020 Jun 24  Resolved: 2017 Feb 06

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G), Server (S)
Affects Version/s: 3.0.1
Fix Version/s: 3.2.0

Type: Change Request Priority: Major
Reporter: Ingus Vilnis Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: aliases, lld
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Sprint: Sprint 1

 Description   

Zabbix UserParameters in agent configuration file support flexible parameters by using UserParameter=key[*],command syntax.

It would be very useful to have the same approach for Alias setting in agent configuration file because currently Alias accepts only hardcoded item keys with all macros (e.g. LLD) already manually resolved.

This issue originally is an attempt to find a vague workaround for ZBXNEXT-1606 and ZBXNEXT-3205.

Example:

# This works as expected currently
Alias=vfs.fs.discovery.1:vfs.fs.discovery

# This does not work currently and should accept all resolved LLD macros and key parameters from server
Alias=vfs.fs.size.1[*]:vfs.fs.size[*]


 Comments   
Comment by Alexander Vladishev [ 2016 Sep 07 ]

Aliases in the configuration file

  1. vfs.fs.discovery[*]:vfs.fs.discovery
  2. cpu.util[*]:system.cpu.util[*]
  3. cpu.util:system.cpu.util
item key old behaviour new behavior processed key
vfs.fs.discovery[*] 1st alias 1st alias vfs.fs.discovery
vfs.fs.discovery[ *]   1st alias vfs.fs.discovery
vfs.fs.discovery[a, "b", c]   1st alias vfs.fs.discovery
cpu.util 3rd alias 3rd alias system.cpu.util
cpu.util[all, idle, avg15]   2nd alias system.cpu.util[all, idle, avg15]
Comment by Glebs Ivanovskis (Inactive) [ 2016 Sep 07 ]

(1) It is worth checking that len_name and len_value are at least 3.

sasha RESOLVED in r62356

glebs.ivanovskis Logic is not correct. If I have Alias=long_alias_name:agent.version I will get

$ zabbix_agentd -c /path/to/config/file.conf -t long_alias_name_some_random_rubbish
long_alias_name_some_random_rubbish           [s|3.2.0beta3]

REOPENED

sasha Thanks! RESOLVED in r62365

glebs.ivanovskis CLOSED

Comment by Glebs Ivanovskis (Inactive) [ 2016 Sep 07 ]

(2) I'm not sure about magical 2 in strncmp(alias->name, orig, len_name - 2), setting Alias=test[*]:agent.ping in config file leads to

$ zabbix_agentd -c /path/to/config/file.conf -t test
test                                          [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
$ zabbix_agentd -c /path/to/config/file.conf -t test[
test[                                         [u|1]

sasha RESOLVED in r62364

glebs.ivanovskis CLOSED

Comment by Alexander Vladishev [ 2016 Sep 07 ]

(3) Documentation

VSI Documented in:

These updates in documentation also cover issue in ZBXNEXT-1606. However functionality requested in mentioned ZBXNEXT-3205 is yet to be tested and to be documented (if needed) in scope of ZBXNEXT-3205.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Sep 08 ]

Successfully tested.

Comment by Alexander Vladishev [ 2016 Sep 08 ]

Available in pre-3.2.0rc1 (trunk) r62375.

Generated at Thu Apr 18 09:09:19 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.