Ad Widget

Collapse

Force Zabbix Server to Use Specific Interface

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #16
    LOL!

    I'll try and dl the latest then. Why didn't you comment on the blog, it would have saved me a "little" work... ;-)
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #17
      I didn't know you are working on this!
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #18
        Hmmm... interesting avenue ya'll took to do it. I'll try and send you the patch anyway. The route I took was a little shorter and had a lower impact on overall code.

        I setup a global variable in the comms.c file (ya I know that can be bad form) which had a "set" function associated with it. In the zbx_tcp_connect function it would branch to the bind statement if the BINDIP variable had been set, otherwise nothing would be done.

        I'll start testing pre7 to see how it goes.
        RHCE, author of zbxapi
        Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
        Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #19
          It is not only TCP connect! Note that ICMP ping and SNMP connection are also affected.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • nelsonab
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2006
            • 1233

            #20
            Hmmm... good point.

            And it works!

            Thanks!

            Any word on when the next release 1.4.x release will be?
            RHCE, author of zbxapi
            Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
            Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

            Comment

            • tekknokrat
              Senior Member
              • Sep 2008
              • 140

              #21
              the approaches to workaround the source ip issue sounds complicated and would change whole networkconfiguration.

              +1 for source address at least using listenaddress from config.

              Comment

              • Alexei
                Founder, CEO
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Sep 2004
                • 5654

                #22
                In 1.6, new SourceIP parameter can be used to specify source IP for all ZABBIX processes (agent, server, proxy).
                Alexei Vladishev
                Creator of Zabbix, Product manager
                New York | Tokyo | Riga
                My Twitter

                Comment

                • tekknokrat
                  Senior Member
                  • Sep 2008
                  • 140

                  #23
                  Originally posted by Alexei
                  In 1.6, new SourceIP parameter can be used to specify source IP for all ZABBIX processes (agent, server, proxy).
                  nice I am going to test this.

                  Comment

                  • nelsonab
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Sep 2006
                    • 1233

                    #24
                    Originally posted by tekknokrat
                    nice I am going to test this.
                    It works as advertised. :-D
                    RHCE, author of zbxapi
                    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
                    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

                    Comment

                    • NOB
                      Senior Member
                      Zabbix Certified Specialist
                      • Mar 2007
                      • 469

                      #25
                      Originally posted by selin
                      We have Zabbix installed on a LinuxHA cluster. The configuration is as follows:

                      LNXZBX01
                      eth0 10.4.4.105
                      eth0:1 10.4.4.107 (floating/virtual IP)

                      LNXZBX02
                      eth0 10.4.4.106
                      eth0:1 10.4.4.108 (floating/virtual IP)

                      The cluster does what it is designed to do - fails over the MySQL instance and the IP (10.4.4.107). Unfortunately, the virtual IP is not being used by the Zabbix server to communicate with the agents - instead 10.4.4.105 is used. Hence, the agents reject the connection with the message:

                      Connection from [10.4.4.105] rejected. Allowed server is [10.4.4.107]

                      Is there a way of specifying the outbound IP to use for the Zabbix server? Setting the Server=10.4.4.105 in the zabbix_agentd.conf file basically negates the value of the cluster. Not having eth0 set with an IP means that when we choose to take the cluster down, we cannot communicate with the rest of the network.

                      Any ideas? I saw the patch to work by name, but I was wondering if there was a parameter that I had missed or if the functionality was to be added in the future...?
                      Yes, now it's possible but it is not really required for your (simple) setup !
                      The SourceIP= (in 1.6) doesn't work out of the box with fping, e.g. on RedHat 5 Enterprise Linux.
                      This needs an unofficial patch for fping, and RH5 EL seems to not provide that patched version of fping.
                      Other posts state that CentOS uses a different option for Fping (-I) than other distro's like Debian (-S).
                      And, again, this is not necessary. It'll use the normal routing on your box.
                      Normally it shouldn't matter where the "fping" is coming from.

                      If you configure the agent like this
                      Code:
                      Server=10.4.4.107,10.4.4.105,10.4.4.106
                      you won't have any problems with your virtual IP. The active checks are send to the virtual IP,
                      which should be available all the time (that's why you installed ZABBIX as a cluster) and the
                      other IPs of your ZABBIX-Servers are permitted to do normal checks.

                      IMO, there is just one occasion where you really need this new feature:

                      If you have DM installed/configured and the ZABBIX-Master is a
                      cluster.
                      In that case you can either reconfigure the routing or use SourceIP=

                      Regards

                      Norbert.
                      Last edited by NOB; 04-11-2008, 12:06. Reason: Explained the agent config in greater detail / Corrected the statement for fping

                      Comment

                      • tekknokrat
                        Senior Member
                        • Sep 2008
                        • 140

                        #26
                        Originally posted by nelsonab
                        It works as advertised. :-D
                        of course, I forgot to post that.

                        Comment

                        Working...