[ZBX-25218] Agent autoreg does not re-enable a disabled host Created: 2024 Sep 11  Updated: 2025 Jan 09  Resolved: 2024 Dec 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 6.4.18
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Leonardo Luis Southier Assignee: Sergejs Boidenko
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2025-01-09 at 13.51.42.png    
Issue Links:
Causes
caused by ZBXNEXT-3290 Reduce the synchronization data size ... Closed
Duplicate
Team: Team B
Sprint: S24-W40/41, S24-W42/43, S24-W44/45, S24-W48/49, S24-W50/51/52/1
Story Points: 3

 Description   

Steps to reproduce:

1 - Environment with Zabbix server + proxy + agent, all on version 5.0.36
2 - Configure an auto-registration action with the following operations: Add host, Add to host groups: Linux servers, Link to templates: Template OS Linux by Zabbix agent, Enable host. Condition: Host metadata matches zabbix-1.
3 - Configure the agent to connect to the proxy for auto-registration, Hostmetadata=zabbix-1.
4 - When the agent starts, it will register itself in Zabbix.
5 - Manually disable the host in Zabbix.
6 - In the condition of the autoreg action, change the Hostmetadata value to zabbix-2.
7 - Change the same value in the agent's configuration and restart the agent.
The host will be re-enabled in Zabbix.
8 - Upgrade the Zabbix server, proxy, and agent to version 6.4.18.
9 - Repeat step 5.
10 - Repeat steps 6 and 7, changing the value to zabbix-3.
The host will no longer be re-enabled.

Result:

With the entire environment on version 5.0.12, the agent reactivates the host that was manually disabled. In version 6.4.18, this did not happen, and the host remained disabled in Zabbix.
Below is the agent 5.0.36 log.

trapper got '{"request":"proxy data","host":"PROXY","session":"d5912c95a9682c9079e67e1450b72050","auto registration":[

{"clock":1725635191,"host":"AGENTE","ip":"192.168.17.25","port":"10050","host_metadata":"zabbix-3","tls_accepted":1}

],"version":"5.0.36","clock":1725635192,"ns":507162592}'
  5728:20240906:120632.507 In zbx_recv_proxy_data()
  5728:20240906:120632.507 In zbx_hc_check_proxy() proxyid:10438
  5728:20240906:120632.507 End of zbx_hc_check_proxy():SUCCEED
  5728:20240906:120632.507 In process_proxy_data()
  5728:20240906:120632.507 process_proxy_data() flag_win:0/0 flag:16 proxy_status:5 period_end:0 delay:1 timestamp:1725635192 lastaccess:1725635191 proxy_delay:0 more:0
  5728:20240906:120632.507 In process_autoregistration_contents()
  5728:20240906:120632.507 In is_ip4() ip:'192.168.17.25'
  5728:20240906:120632.507 End of is_ip4():SUCCEED
  5728:20240906:120632.507 query [txnlev:1] [begin;]
  5728:20240906:120632.507 In DBregister_host_flush()
  5728:20240906:120632.507 In DBregister_host_active()
  5728:20240906:120632.507 query [txnlev:1] [select null from actions where eventsource=2 and status=0]
  5728:20240906:120632.508 End of DBregister_host_active():SUCCEED
  5728:20240906:120632.508 query [txnlev:1] [select h.host,h.hostid,h.proxy_hostid,a.host_metadata,a.listen_ip,a.listen_dns,a.listen_port,a.flags,a.autoreg_hostid from hosts h left join autoreg_host a on a.proxy_hostid=h.proxy_hostid and a.host=h.host where h.host='AGENTE']
  5728:20240906:120632.508 query [txnlev:1] [select autoreg_hostid,host from autoreg_host where host='AGENTE']
  5728:20240906:120632.508 query [txnlev:1] [update autoreg_host set listen_ip='192.168.17.25',listen_dns='',listen_port=10050,host_metadata='zabbix-3',tls_accepted='1',flags=0,proxy_hostid=10438 where autoreg_hostid=1;
]
  5728:20240906:120632.508 In zbx_process_events() events_num:1
  5728:20240906:120632.508 In DCget_nextid() table:'events' num:1
  5728:20240906:120632.508 End of DCget_nextid() table:'events' [36:36]
  5728:20240906:120632.508 In DCget_nextid() table:'events' num:0
  5728:20240906:120632.508 End of DCget_nextid() table:'events' [37:36]
  5728:20240906:120632.508 query [txnlev:1] [insert into events (eventid,source,object,objectid,clock,ns,value,name,severity) values (36,2,3,1,1725635191,0,1,'',0);
]
  5728:20240906:120632.508 In process_actions() events_num:1
  5728:20240906:120632.508 In zbx_dc_config_history_sync_get_actions_eval()
  5728:20240906:120632.508 End of zbx_dc_config_history_sync_get_actions_eval() actions:2
  5728:20240906:120632.508 In check_events_condition() actionid:7 conditionid:9 cond.value:'zabbix-3' cond.value2:''
  5728:20240906:120632.508 In check_auto_registration_condition()
  5728:20240906:120632.508 query [txnlev:1] [select autoreg_hostid,host_metadata from autoreg_host where autoreg_hostid=1]
  5728:20240906:120632.508 End of check_auto_registration_condition()
  5728:20240906:120632.508 End of check_events_condition()
  5728:20240906:120632.508 In check_events_condition() actionid:8 conditionid:10 cond.value:'zabbix-2' cond.value2:''
  5728:20240906:120632.508 In check_auto_registration_condition()
  5728:20240906:120632.508 query [txnlev:1] [select autoreg_hostid,host_metadata from autoreg_host where autoreg_hostid=1]
  5728:20240906:120632.509 End of check_auto_registration_condition()
  5728:20240906:120632.509 End of check_events_condition()
  5728:20240906:120632.509 In check_action_conditions() actionid:8 eventsource:2
  5728:20240906:120632.509  conditionid:10 conditiontype:24 cond.value:'zabbix-2' cond.value2:'' result:FAIL
  5728:20240906:120632.509 End of check_action_conditions():FAIL
  5728:20240906:120632.509 In check_action_conditions() actionid:7 eventsource:2
  5728:20240906:120632.509  conditionid:9 conditiontype:24 cond.value:'zabbix-3' cond.value2:'' result:SUCCEED
  5728:20240906:120632.509 End of check_action_conditions():SUCCEED
  5728:20240906:120632.509 In execute_operations() actionid:7
  5728:20240906:120632.509 query [txnlev:1] [select o.operationtype,g.groupid,t.templateid,oi.inventory_mode from operations o left join opgroup g on g.operationid=o.operationid left join optemplate t on t.operationid=o.operationid left join opinventory oi on oi.operationid=o.operationid where o.actionid=7 order by o.operationid]
  5728:20240906:120632.509 In op_host_enable()
  5728:20240906:120632.509 In add_discovered_host() eventid:36
  5728:20240906:120632.509 query [txnlev:1] [select proxy_hostid,host,listen_ip,listen_dns,listen_port,flags,tls_accepted from autoreg_host where autoreg_hostid=1]
  5728:20240906:120632.509 query [txnlev:1] [select null from hosts where host='AGENTE' and status=3]
  5728:20240906:120632.509 query [txnlev:1] [select hostid,proxy_hostid from hosts where host='AGENTE' and flags<>2 and status in (0,1) order by hostid limit 1]
  5728:20240906:120632.509 In DBadd_interface()
  5728:20240906:120632.509 query [txnlev:1] [select interfaceid,useip,ip,dns,port,main from interface where hostid=10440 and type=1]
  5728:20240906:120632.509 In substitute_simple_macros_impl() data:'10050'
  5728:20240906:120632.509 End of DBadd_interface():3
  5728:20240906:120632.509 End of add_discovered_host()
  5728:20240906:120632.509 query [txnlev:1] [update hosts set status=0 where hostid=10440]

Below is the agent 6.4.18 log
 In send_buffer() host:'192.168.17.24' port:10051 entries:0/100
  2777:20240911:150445.717 End of send_buffer():SUCCEED
  2777:20240911:150445.717 zbx_setproctitle() title:'active checks #1 [getting list of active checks]'
  2777:20240911:150445.717 In refresh_active_checks() host:'192.168.17.24' port:10051
  2777:20240911:150445.717 In zbx_connect_to_server() [192.168.17.24]:10051 [timeout:3, connection timeout:3]
  2777:20240911:150445.717 In zbx_is_ip4() ip:'192.168.17.24'
  2777:20240911:150445.717 End of zbx_is_ip4():SUCCEED
  2777:20240911:150445.717 sending [{"request":"active checks","host":"AGENTE","host_metadata":"zabbix-6","config_revision":0,"session":"364b2d26f099026c8266607bb3b2df51"}]
  2777:20240911:150445.717 before read
  2777:20240911:150445.721 got [{"response":"failed","info":"host "AGENTE" not monitored"}]
  2777:20240911:150445.721 In parse_list_of_checks()
  2777:20240911:150445.721 no active checks on server [192.168.17.24:10051]: host "AGENTE" not monitored
  2777:20240911:150445.721 End of parse_list_of_checks():FAIL
  2777:20240911:150445.721 End of refresh_active_checks():SUCCEED

Expected:

The agent 6.4.18 should reactivate the host after the Hostmetadata is changed and the agent is restarted.



 Comments   
Comment by Leonardo Luis Southier [ 2024 Sep 24 ]

Hi

 

Should Zabbix 6.4.x also receive the fix, or only version 7?

 

Best regards

Leonardo

Comment by Alexander Vladishev [ 2024 Sep 30 ]

Version 6.4 is no longer fully supported. We are only addressing critical issues and vulnerabilities in it.

The issue described above is not considered critical.

Comment by Leonardo Luis Southier [ 2024 Oct 01 ]

Ok.

Thank you.

Comment by Sergejs Boidenko [ 2024 Dec 19 ]

Resolved in ZBX-25089

Comment by Backoffice Team [ 2024 Dec 19 ]

I dont think its the same as ZBX-25089. That ticket was created for proxy groups introduced in 7.0, and this issue we are in complains about this error in 6.4 (maybe earlier) where the feature of proxy group did not exist yet.

Maybe they are related, but i'd like that confirmation and to see that ZBX-25089 testing this case too, before closing this ticket.

Comment by Sergejs Boidenko [ 2025 Jan 06 ]

Issue is solved under ZBX-25089

Comment by dimir [ 2025 Jan 09 ]

backoffice.team I think Sergejs is trying to tell you that the issue that you mention is indeed different but it was fixed under ZBX-25089. However, if I understood correctly you are still on 6.4, which is now discontinued

thus there is no way you will get this fixed in 6.4 unfortunately. I suggest upgrading and see if your issue is fixed in 7.0.8, which got the work from ZBX-25089. If you decide to go for upgrade and will notice that it's not fixed in 7.0.8 please re-open this issue.

Generated at Wed May 21 06:32:22 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.