Ad Widget

Collapse

Cannot connect to zabbix agent with NAT

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • javitojim
    Junior Member
    • May 2018
    • 1

    #1

    Cannot connect to zabbix agent with NAT

    Hi everyone!

    I have a problem with my Zabbix platform, at once end of my platform I have servers that go through a nailed connection.
    These servers do not report to the Zabbix proxy, although there is connection between both sides of the network. There is telnet through ports 10050 and 10051 on both sides of the connection.

    Example: Telnet to agent is OK

    Code:
    [root @ XXXX ~] # telnet 2.1.0.31 10050
    Trying 2.1.0.31 ...
    Connected to 2.1.0.31.
    Escape character is '^]'.
    And towards the other end the same, from the agent to the server through the perfect port 10051. However, the proxy and the console are not able to do ./zabbix_get because of the following message:

    Code:
    [root @ XXXX bin] # ./zabbix_get -s 2.1.0.31 -p 10050 -k agent.version
    zabbix_get [53645]: Get value error: ZBX_TCP_READ () failed: [104] Connection reset by peer
    zabbix_get [53645]: Check access restrictions in Zabbix agent configuration
    In the configuration of the file Zabbix_agentd.conf I have included as server the proxy server to which Zabbix points, both with its local IP and the Nated IP with which it is presented to the agents.

    Code:
    My Zabbix config:
    Server: Zabbix 3.4
    Proxy: Zabbix 3.4
    Agent: Zabbix Agent 3.4.3
    Can someone help me?


    Thanks in advance
  • aigars.kadikis
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2018
    • 208

    #2
    Since the agent is monitored by proxy AND by looking into zabbix_agentd.conf there is a line "Server=" which this time point out to 127.0.0.1. This means you can ask agent to give some metrics only from 127.0.0.1. This should work:
    Code:
    ./zabbix_get -s 127.0.0.1 -p 10050 -k agent.version
    Another solution is to let agent to respond to the queries which comes from multiple locations. To proceed that please modify zabbix_agentd.conf file and set 2 IP addresses (this works as a white-list):
    Code:
    Server=127.0.0.1,2.1.0.31
    Restart the agent.

    Now the agent is instructed to answer either from proxy or either from the main server directly.

    Regards,

    Comment

    Working...