[ZBX-11737] Target list is redundant in Action -> Operation for remote command executed on server Created: 2017 Jan 24  Updated: 2022 Jun 15

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F), Server (S)
Affects Version/s: 3.0.6, 3.0.7, 3.2.2, 3.2.3
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Vjaceslavs Bogdanovs Assignee: Alexei Vladishev
Resolution: Unresolved Votes: 1
Labels: actionoperations, host, macros, remotecommands
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File target_list.png    
Issue Links:
Duplicate
duplicates ZBX-6554 remote commands on server not documented Closed

 Description   

There is an option to select targets for remote commands executed on server (in Action -> Operations):

When multiple hosts are specified it results multiple same command executions, and all macros are being expanded for "Current host" context.

Documentation states that "A command on a host is executed only once, even if the host matches more than once (e.g. from several host groups; individually and from a host group)" and "host level macros are checked first".

So as far as I understand, there should be:
A change in macro expansion logic so this feature can be used to specify host-specific macro in remote command
or
Target list should be removed from remote commands executed on server as all commands are executed in "current host context"



 Comments   
Comment by richlv [ 2018 Mar 27 ]

this might be a duplicate of ZBX-11543

Comment by Giton Xu [ 2018 Nov 01 ]

"When multiple hosts are specified it results multiple same command executions, and all macros are being expanded for "Current host" context."

This is the key point. No matter what is in the target list, {HOST.IP}s in script are expanded to the same IP, that of the 'current host'.

And I am running Zabbix 4.0.

Generated at Fri Apr 04 18:59:23 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.