Ad Widget

Collapse

Zabbix agent Connection refused

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • c94660
    Junior Member
    • Jun 2016
    • 5

    #1

    Zabbix agent Connection refused

    Hello,

    I have installed an zabbix-agent on a Windows host, while the zabbix-server on CentOS host, but get value error: cannot connect to [[172.16.5.17]:10050]: [111] Connection refused. The zabbix_get command is not working too.
    I shutdown the firewall, and there's the same error.
    The agent in the same network segment is working well.

    How can I resolve this problem?

    Thanks.

    Cheng
  • GPegel
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2015
    • 113

    #2
    Could you try to do a nmap?

    From CentOS I started nmap to a Windows Server like this:

    Code:
    nmap -Pn -p10050 <servername>
    And I got these results back:

    Code:
    Starting Nmap 6.40 ( http://nmap.org ) at 2016-06-30 10:51 CEST
    Nmap scan report for servername (ip.address.of.server)
    Host is up (0.00047s latency).
    rDNS record for ip.address.of.server: servername
    PORT      STATE SERVICE
    10050/tcp open  unknown
    MAC Address: 12:34:56:78:90:00 (VMware)
    As you can see, port 10050 is open. So try this first. If it says 'state: closed' then you know that you have to open the port on the Windows server.

    Comment

    • Balaraju
      Member
      • Jun 2016
      • 40

      #3
      Zabbix agent Connection refused

      Hi ,

      for testing purpose disable the firewall and type this below command.

      Telnet the server :
      telnet <server ip> 10050

      if it telnet works good ,use below command.

      /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf

      If it's work then enable the firewall and try again.

      Comment

      • c94660
        Junior Member
        • Jun 2016
        • 5

        #4
        Originally posted by GPegel
        Could you try to do a nmap?

        From CentOS I started nmap to a Windows Server like this:

        Code:
        nmap -Pn -p10050 <servername>
        And I got these results back:

        Code:
        Starting Nmap 6.40 ( http://nmap.org ) at 2016-06-30 10:51 CEST
        Nmap scan report for servername (ip.address.of.server)
        Host is up (0.00047s latency).
        rDNS record for ip.address.of.server: servername
        PORT      STATE SERVICE
        10050/tcp open  unknown
        MAC Address: 12:34:56:78:90:00 (VMware)
        As you can see, port 10050 is open. So try this first. If it says 'state: closed' then you know that you have to open the port on the Windows server.
        Sorry for reply so late.
        I tried telnet agent client's 10050 port from server host, but it's failed when I shutdown all the firewalls. Then I telnet 127.0.0.1:10050 on agent client host itself, it's working, so strange problem.
        ps: nmap command is not found.

        Comment

        • valegator
          Junior Member
          • Jul 2016
          • 18

          #5
          Add your server to the allowed hosts list

          The agent itself is probably refusing the connection, not the firewall.
          Did you list your server in the Zabbix Agent config file like this:
          Server="yourServerFQDNorIP"

          If not, the server is not allowed to connect.
          How to implement a config file with windows agent:

          The parameters:

          Comment

          • c94660
            Junior Member
            • Jun 2016
            • 5

            #6
            Originally posted by valegator
            The agent itself is probably refusing the connection, not the firewall.
            Did you list your server in the Zabbix Agent config file like this:
            Server="yourServerFQDNorIP"

            If not, the server is not allowed to connect.
            How to implement a config file with windows agent:

            The parameters:
            https://www.zabbix.com/documentation...bix_agentd_win
            I have already set the server ip in the config file like this:
            server="myServerIP"
            serverActive="myServerIP:10051"
            but it's not working

            Comment

            • valegator
              Junior Member
              • Jul 2016
              • 18

              #7
              DebugLevel and Services

              Is the Windows Service of Zabbix Agent running and do you find your host listening on port 10050 when executing "netstat -ao" in the command line?
              Did you check the Zabbix Agent's agentd.log file in the Agent install folder for any errors?
              If you do not find any useful information there, you can set the DebugLevel for the agent higher to troubleshoot.

              Comment

              • c94660
                Junior Member
                • Jun 2016
                • 5

                #8
                Originally posted by valegator
                Is the Windows Service of Zabbix Agent running and do you find your host listening on port 10050 when executing "netstat -ao" in the command line?
                Did you check the Zabbix Agent's agentd.log file in the Agent install folder for any errors?
                If you do not find any useful information there, you can set the DebugLevel for the agent higher to troubleshoot.
                The Windows zabbix agent is running, and listening on port 10050.
                The agentd.log shows an error after start agent: failed to accept an incoming connection: connection from "127.0.0.1" rejected, allowed hosts: "10.20.171.48".
                I thought the incomming connection should be from zabbix server(10.20.171.48), but it looks like from agent host self. Strange!
                I'm sure I configured "Server=10.20.171.48" and "ServerActive=10.20.171.48:10051" in the configuration file, which the agent started with.
                Is it right?
                Last edited by c94660; 15-07-2016, 05:36.

                Comment

                • c94660
                  Junior Member
                  • Jun 2016
                  • 5

                  #9
                  Originally posted by valegator
                  Is the Windows Service of Zabbix Agent running and do you find your host listening on port 10050 when executing "netstat -ao" in the command line?
                  Did you check the Zabbix Agent's agentd.log file in the Agent install folder for any errors?
                  If you do not find any useful information there, you can set the DebugLevel for the agent higher to troubleshoot.
                  With the debug level 4, the log repeat like this:
                  ------------------------------------------------------------
                  In collect_perfstat()
                  End of collect_perfstat()
                  In send_buffer() host:'10.20.171.48' port:10051 entries:0/100
                  End of send_buffer():SUCCEED
                  ------------------------------------------------------------

                  And this:
                  -----------------------------------------------------------
                  In refresh_active_checks() host:'10.20.171.48' port:10051
                  sending [{"request":"active checks","host":"web5"}]
                  before read
                  got [{"response":"success","data":[]}]
                  In parse_list_of_checks()
                  End of parse_list_of_checks():SUCCEED
                  End of refresh_active_checks():SUCCEED
                  In process_active_checks() server:'10.20.171.48' port:10051
                  End of process_active_checks()
                  In get_min_nextcheck()
                  End of get_min_nextcheck():-1
                  In collect_perfstat()
                  End of collect_perfstat()
                  -------------------------------------------------------------
                  It seems no error happened.
                  Last edited by c94660; 15-07-2016, 08:22.

                  Comment

                  Working...