Ad Widget

Collapse

Auto-registration does not work - how can I debug it?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OttoK
    Junior Member
    • Jan 2013
    • 9

    #1

    Auto-registration does not work - how can I debug it?

    Hello,

    I've read every available documentation item and forum post on auto-discovery, and I've checked many times over that my configurations are correct. Still, auto-registration does not work.

    Manually registering hosts works fine. Network auto-discovery works fine. But auto-registration not.

    How do I debug the situation to see what is happening, how far the auto-registration message goes and where it fails?

    When I restart the agent it outputs in the log this:

    Code:
     
     24059:20130103:004116.106 Starting Zabbix Agent [xxxx]. Zabbix 2.0.3 (revision 30485).
     24061:20130103:004116.107 agent #0 started [collector]
     24065:20130103:004116.108 agent #3 started[listener]
     24063:20130103:004116.108 agent #2 started[listener]
     24062:20130103:004116.108 agent #1 started[listener]
    How do I know if it even tried to do an auto-registration? Is the agent supposed to try auto-register each time it is started? I can't find that there is any --debug option to run the agent to figure out what it does.

    From the host I ran
    Code:
    telnet zabbix.server.address 10051
    and I get a prompt, so I know that at least the network connection works and is not firewalled etc.

    On the Zabbix server the server log does not show anything related.

    What can I do the debug this? It is really important to get auto-registration working, without it Zabbix would be way less useful.
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    So you have set up the proper action/condition for this, right?

    And in your zabbix_agentd.conf file for your hosts, you have the ServerActive= field set properly to your Zabbix server? I don't know that this is necessary, but I use it.

    Here is a screenshot of the operation for my action. I link to the stock Template App Zabbix Agent:
    Attached Files
    Last edited by tchjts1; 03-01-2013, 16:54.

    Comment

    • OttoK
      Junior Member
      • Jan 2013
      • 9

      #3
      I finally found the problem. Active checks only work if you have the field ServerActive defined in the agentd conf.

      This piece of magic wasn't documented anywhere. There was no ServerActive directive in the agentd conf (even though it seems to list all other configuration options commented) and the wiki page on the topic had an error.

      I fixed the wiki now:


      The error is still in the official documentation but I don't have access to that:

      Comment

      • harri
        Member
        • Nov 2010
        • 89

        #4
        The *real* question remains unanswered: How can I debug auto-registration? I would like to examine auto-registration events sent by an agent to a server, including proxies.

        Comment

        • Sir_Yaro
          Member
          • Nov 2008
          • 37

          #5
          I think I know how to degug it but I don't really understand what does it mean...

          $ tail -f zabbix_server.log|grep -i 10.2.5.48
          24897:20180905:101024.000 trapper got '{"request":"active checks","host":"ip-10-2-5-48.eu-west-1.compute.internal"}'
          24897:20180905:101024.000 In is_ip4() ip:'10.2.5.48'
          24897:20180905:101024.000 In get_hostid_by_host() host:'ip-10-2-5-48.eu-west-1.compute.internal'
          24897:20180905:101024.000 query [txnlev:0] [select hostid,status,tls_accept,tls_issuer,tls_subject,tl s_psk_identity from hosts where host='ip-10-2-5-48.eu-west-1.compute.internal' and status in (0,1) and flags<>2 and proxy_hostid is null]
          24897:20180905:101024.002 query [txnlev:1] [select autoreg_hostid,host from autoreg_host where proxy_hostid is null and host='ip-10-2-5-48.eu-west-1.compute.internal']
          24897:20180905:101024.002 query [txnlev:1] [update autoreg_host set listen_ip='10.2.5.48',listen_dns='ip-10-2-5-48.eu-west-1.compute.internal',listen_port=10050,host_metadat a='' where autoreg_hostid=1820;
          24897:20180905:101024.003 query [txnlev:1] [select null from hosts where host='ip-10-2-5-48.eu-west-1.compute.internal' and status=3]
          24897:20180905:101024.003 query [txnlev:1] [select hostid,proxy_hostid from hosts where host='ip-10-2-5-48.eu-west-1.compute.internal' and flags<>2 and status in (0,1) order by hostid limit 1]
          24897:20180905:101024.004 query [txnlev:1] [insert into hosts (hostid,proxy_hostid,host,name,description) values (10258,null,'ip-10-2-5-48.eu-west-1.compute.internal','ip-10-2-5-48.eu-west-1.compute.internal','');
          24897:20180905:101024.005 query [txnlev:1] [insert into interface (interfaceid,hostid,main,type,useip,ip,dns,port) values (2,10258,1,1,1,'10.2.5.48','ip-10-2-5-48.eu-west-1.compute.internal',10050)]
          24897:20180905:101024.056 cannot send list of active checks to "10.2.5.48": host [ip-10-2-5-48.eu-west-1.compute.internal] not found
          24897:20180905:101024.056 send_list_of_active_checks_json() sending [{"response":"failed","info":"host [ip-10-2-5-48.eu-west-1.compute.internal] not found"}]
          $
          When I run above queries manually host obviously pops up into zabbix UI. But why this queries fails I have no idea...

          Comment

          Working...