[ZBX-24029] Zabbix - Trigger action ignores "Target list" in remote commands Created: 2024 Feb 01 Updated: 2024 Feb 16 |
|
Status: | Confirmed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 6.4.11 |
Fix Version/s: | None |
Type: | Problem report | Priority: | Critical |
Reporter: | TC | Assignee: | Zabbix Development Team |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() ![]() |
Description |
Hi everyone,
I'm reporting something I found in Zabbix 6.4.8. Trigger actions sending remote commands (SNMPSET) to two different hosts.
Commands are global scripts of SNMPSET: snmpset -v2c -c {SNMP.COMMUNITY} {HOST.IP} {SNMP.OID} i {SNMP.WRITTINGVALUE}
Conditions are met: -> step 1 send command to HOST.1; -> step 2 send command to HOST.2;
In the Action Report we see: STEP 1-> {HOST.1}:snmpset -v2c -c avacw {SNMP.COMMUNITY} {HOST.IP1} {SNMP.OID} i {SNMP.WRITTINGVALUE} STEP 2-> {HOST.2}:snmpset -v2c -c avacw {SNMP.COMMUNITY} {HOST.IP1} {SNMP.OID} i {SNMP.WRITTINGVALUE}
For a reason I can't explain, the IP in the script command for HOST.2 gets filled with the IPaddress of HOST.1
In Zabbix 4.4.1 this Trigger action works as intended. The command gets sent to the correct IP address. |
Comments |
Comment by Edgars Melveris [ 2024 Feb 02 ] |
Hello! |
Comment by TC [ 2024 Feb 02 ] |
Yes both commands are executed in one action, the scripts are different, the writting value to turn ON is different than the writting value to turn OFF.
the script is a SNMPSET string: snmpset -v2c -c {SNMP.COMMUNITY} {HOST.IP} {SNMP.OID} i {SNMP.WRITTINGVALUE}
The only real macro in the script is * {HOST.IP}* the others I altered for the sake of posting this issue.
Trigger expression: last(/Template HVAC/OnOffAirCon)={SNMP.WRITTINGVALUE}
Both Hosts use the same Template, diferent IP and Name for each host.
The action steps are sellecting the correct script, but the second step even though its configured to send the command to HOST.2, it fills the IP of HOST.1 address in the script.
Script Configuration Note: the turn ON script is basicaly the same only difference is the SNMP Value.
Action Configuration
|
Comment by Edgars Melveris [ 2024 Feb 05 ] |
Can you also show the trigger configuration? Is the problem detected on host1 only? |
Comment by TC [ 2024 Feb 05 ] |
The problem happens for all hosts I've tested, it seems like Zabbix is "saving" the IP from the first step, and populates this IP in every step. Even though another Host is being called as can be seem from the images provided.
I've tested with multiple Hosts and the problem happens everytime with this version of Zabbix.
Trigger configuration is bellow:
And action report, I redacted some information. The IP address only shows the lasted digit. And we can see the instances where the action conditions we're met, it sends a command to turn ON (49) Host1 then, 1-3 minutes later it sends a command to turn OFF (48) Host2, but the IP is the same.
The problem is not in the action conditions or Steps, because this exact same actions is being used correctly in Zabbix 4.4.
|
Comment by Edgars Melveris [ 2024 Feb 15 ] |
Confirmed
echo {HOST.IP} >> /var/log/zabbix/action.test.log
And use host "host 1" with interface 10.1.1.1: In the file I get: *UNKNOWN* Which means it's trying to resolve it on host "test", that doesn't have an interface, not on "host 1" which I selected. |