Ad Widget

Collapse

Server to 2 ip's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Novgor
    Junior Member
    • Dec 2023
    • 11

    #1

    Server to 2 ip's

    Hello everyone,
    I need help. My server is currently running at address x.x.x.57. I want it to still work from the address x.x.x.8. I added addresses in ListenIP= to the server config, but still the agents do not want to connect if you specify Server/ServerActive x.x.x.8 in the agent config.
    Error: 1044591:20231208:094238.681 failed to accept an incoming connection: connection from "109.206.171.57" rejected, allowed hosts: "62.122.169.8"
    ​What am I missing?
    The server needs to work with agents both x.x.x.57 and x.x.x.8.​
  • solution
    Senior Member
    • Jun 2020
    • 269

    #2
    Learn how to define allowed servers in:
    Server:


    Agent:


    Wellington​

    Comment

    • Novgor
      Junior Member
      • Dec 2023
      • 11

      #3
      Hello.

      Code:
      root@zabbix:~# zabbix_server -V
      zabbix_server (Zabbix) 5.0.14​
      
      root@zabbix:~# cat /etc/zabbix/zabbix_server.conf|grep Listen
      ListenIP=X.X.X.57, X.X.X.8
      
      [ 0 1.9ms ] 05:37:17 root:~# zabbix_agentd -V
      zabbix_agentd (daemon) (Zabbix) 4.0.17
      
      ​[ 0 4.8ms ] 05:37:24 s5161:~# cat /etc/zabbix/zabbix_agentd.conf|grep Server
      Server=X.X.X.8
      ServerActive=X.X.X.8

      Logs:
      Code:
      1845989:20231211:053846.923 failed to accept an incoming connection: connection from "X.X.X.57" rejected, allowed hosts: "X.X.X.8"
      1845990:20231211:053901.308 failed to accept an incoming connection: connection from "X.X.X.57" rejected, allowed hosts: "X.X.X.8"
      1845987:20231211:053916.285 failed to accept an incoming connection: connection from "X.X.X.57" rejected, allowed hosts: "X.X.X.8"​

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        Your server uses .57 for outgoing connections, your agent allows only .8 to connect to it... so that's what it tells you "connection from "X.X.X.57" rejected, allowed hosts: "X.X.X.8""
        ListenIP is for trapper processes, ie if something is sending data to server, it should send it to that IP.
        If you have multiple IP-s on that host, you can force outgoing connections to one IP by specifying SourceIP. But that can be one, not many. If not specifying, first configured one will be used... So you need to decide, which IP you are going to use...

        Comment

        • Novgor
          Junior Member
          • Dec 2023
          • 11

          #5
          Hello, cyber!

          That is, the Zabbix server cannot work on two addresses? To accept part of the requests from agents at .57, and the other part from agents at .8?​

          Comment

          • solution
            Senior Member
            • Jun 2020
            • 269

            #6
            From the logs, your problem is not with the Server.
            It is missing to define ALL IPs that are allowed to collect data from the Agent.

            In the Agent conf define ALL allowed IPs:
            Server=X.X.X.57, X.X.X.8
            ServerActive=X.X.X.57, X.X.X.8


            **https://www.zabbix.com/documentation...ntd_win#server


            Wellington​

            Comment

            • cyber
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Dec 2006
              • 4807

              #7

              Originally posted by Novgor
              Hello, cyber!

              That is, the Zabbix server cannot work on two addresses? To accept part of the requests from agents at .57, and the other part from agents at .8?​
              You are mixing up server config and agent config... Zabbix server will happily accept connections from everywhere and you can make it listen incoming data on multiple IP-s also ("ListenIP" parameter). But you initial error is from agent logs. You have restricted access to agent to one specific IP, which is not used by your server for outgoing connections... As solution said, allow both IP-s to connect to agent and it will work... I would say, allow correct IP to connect... Your server will still use only one IP for connecting to agent (not to mix with agent connecting to server)... You have no place in config to say, that for some outward connections to use one IP and for other some other IP... it will be The One IP. to rule them all..

              Comment

              Working...