Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-25218

Agent autoreg does not re-enable a disabled host

XMLWordPrintable

    • Prev.Sprint, S24-W40/41, S24-W42/43, S24-W44/45
    • 3

      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.

            dponomarenko Deniss Ponomarenko
            lsouthier Leonardo Luis Southier
            Team B
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: