Ad Widget

Collapse

Host not registering on Proxy 5.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shurman
    Member
    • Mar 2014
    • 44

    #1

    Host not registering on Proxy 5.2

    Hi everyone!

    I am trying to implement a proxy configuration. Host configuration data is sent to the proxy from server, however for some reason it is not inthe database...

    Code:
    291954:20210209:125215.210 In process_proxyconfig_table() table:'hosts'
    291954:20210209:125215.210 query [txnlev:1] [select hostid,host,status,available,ipmi_authtype,ipmi_pr ivilege,ipmi_username,ipmi_password,ipmi_available ,snmp_available,jmx_available,name,t
    ls_connect,tls_accept,tls_issuer,tls_subject,tls_p sk_identity,tls_psk from hosts]
    291954:20210209:125215.212 query [txnlev:1] [insert into hosts (hostid,host,status,available,ipmi_authtype,ipmi_p rivilege,ipmi_username,ipmi_password,ipmi_availabl e,snmp_available,jmx_avai
    lable,name,tls_connect,tls_accept,tls_issuer,tls_s ubject,tls_psk_identity,tls_psk,description) values (10001,'Template OS Linux',3,0,-1,2,'','',0,0,0,'Template OS Linux',1,1,'','','','',''
    ),(10050,'Template App Zabbix Agent',3,0,-1,2,'','',0,0,0,'Template App Zabbix Agent',1,1,'','','','',''),(10332,'IVR', 0,0,-1,2,'','',0,0,0,'IVR',1,1,'','','','','' ),(1
    0333,'Asterisk',3,0,-1,2,'','',0,0,0,'Asterisk',1,1,'','','','',''),(10 336,'Zabbix',0,0,-1,2,'','',0,0,0,'Zabbix',1,1,'','','','' ,'');
    ]
    291954:20210209:125215.213 End of process_proxyconfig_table():SUCCEED
    So it looks like it should be in the DB.
    But it is not:

    Code:
    MariaDB [zabbix_proxy]> select * from hosts;
    Empty set (0.000 sec)
    
    MariaDB [zabbix_proxy]> select * from autoreg_host;
    Empty set (0.000 sec)
    and then in proxy log I get
    Code:
    291958:20210209:131304.682 zbx_setproctitle() title:'trapper #5 [processing data]'
    291958:20210209:131304.683 trapper got '{"request":"active checks","host":"IVR"}'
    291958:20210209:131304.683 In send_list_of_active_checks_json()
    291958:20210209:131304.683 In is_ip4() ip:'192.168.22.116'
    291958:20210209:131304.683 End of is_ip4():SUCCEED
    291958:20210209:131304.683 In get_hostid_by_host() host:'IVR' metadata:''
    291958:20210209:131304.683 query [txnlev:0] [select h.hostid,h.status,h.tls_accept,h.tls_issuer,h.tls_ subject,h.tls_psk_identity,a.host_metadata,a.liste n_ip,a.listen_dns,a.listen_port,a.flags from hosts h left join autoreg_host a on a.proxy_hostid is null and a.host=h.host where h.host='IVR' and h.status in (0,1) and h.flags<>2 and h.proxy_hostid is null]
    291958:20210209:131304.752 query [txnlev:1] [begin;]
    291958:20210209:131304.752 query [txnlev:1] [insert into proxy_autoreg_host (clock,host,listen_ip,listen_dns,listen_port,tls_a ccepted,host_metadata,flags) values (1612858384,'IVR','192.168.22.116','',10 050,1,'',0)]
    291958:20210209:131304.753 query [txnlev:1] [commit;]
    291958:20210209:131304.757 End of get_hostid_by_host():FAIL
    291958:20210209:131304.757 cannot send list of active checks to "192.168.22.116": host [IVR] not found
    zabbix-proxy-mysql-5.2.4-1.el8.x86_64 from official repo
  • Shurman
    Member
    • Mar 2014
    • 44

    #2
    Could it be because there is no commit after insert?
    Insert into proxy_autoreg_host is ok:
    Code:
    293480:20210209:135806.672 query [txnlev:1] [begin;]
    293480:20210209:135806.672 query [txnlev:1] [insert into proxy_autoreg_host (clock,host,listen_ip,listen_dns,listen_port,tls_a ccepted,host_metadata,flags) values (1612861086,'IVR
    ','192.168.22.116','',10050,1,'',0)]
    293480:20210209:135806.672 query [txnlev:1] [commit;]
    also, it seems the table keeps filling with duplicate records.... is it supposed to be like this?

    Code:
    MariaDB [zabbix_proxy]> select * from proxy_autoreg_host;
    +----+------------+------------------+----------------+-------------+------------+---------------+-------+--------------+
    | id | clock | host | listen_ip | listen_port | listen_dns | host_metadata | flags | tls_accepted |
    +----+------------+------------------+----------------+-------------+------------+---------------+-------+--------------+
    | 1 | 1612860486 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 2 | 1612860534 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    | 3 | 1612860606 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 4 | 1612860654 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    | 5 | 1612860726 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 6 | 1612860774 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    | 7 | 1612860846 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 8 | 1612860894 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    | 9 | 1612860966 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 10 | 1612861014 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    | 11 | 1612861086 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 12 | 1612861134 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    | 13 | 1612861206 | IVR | 192.168.22.116 | 10050 | | | 0 | 1 |
    | 14 | 1612861254 | Zabbix | 192.168.22.1 | 10050 | flashfon1 | | 0 | 1 |
    +----+------------+------------------+----------------+-------------+------------+---------------+-------+--------------+
    14 rows in set (0.000 sec)

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #3
      Perhaps your problem is simpler and does not require a proxy database investigation
      Check the «Hostname» match in the agent configuration and in the «hostnames» settings of the corresponding host.

      https://www.zabbix.com/documentation.../zabbix_agentd

      Required for active checks and must match hostnames as configured on the server.
      Last edited by Hamardaban; 09-02-2021, 19:41.

      Comment

      • Shurman
        Member
        • Mar 2014
        • 44

        #4
        Originally posted by Hamardaban
        Perhaps your problem is simpler and does not require a proxy database investigation
        Check the «Hostname» match in the agent configuration and in the «hostnames» settings of the corresponding host.
        Thanks
        Of course the host name is the first thing to check, I know they must be identical (using Zabbix since 2008 ;-) ).
        But please note (keeping that the log is from Proxy):
        - the first piece of log is when Server send config to Proxy, with 2 hosts that are configured to be monitored through proxy;
        - the second piece of log is when the Agent requests list of active checks from Proxy.
        In both cases the host name is the same.

        Comment

        Working...