Ad Widget

Collapse

2 Zabbix Proxy instances on the same VM feeding 2 different servers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d.skantzis
    Junior Member
    • Jan 2025
    • 6

    #1

    2 Zabbix Proxy instances on the same VM feeding 2 different servers

    Greetings Everyone.

    For the past few days I am trying to install 2 different Zabbix proxies on the same Ubuntu machine in order to feed 2 different zabbix servers with data.
    Specifically I have Zabbix v5.0.x installed on my Ubuntu VM, and I need to install another proxy v.6.4 on the same VM in order to feed to a different Zabbix Server.

    This is because I have 2 servers, one in Zabbix Server v5.0.4 or smth and another upgraded to v6.4.

    I have tried to install 2 Proxies on my VM and differentiated between the 2 services by renaming them,changing the pid file names, log file names, conf files, listen ports etc. For example:
    Zabbix 6 conf:
    Server=<Zabbix Server 6.x IP>
    Hostname=<Zabbix Proxy 6.xHostname>
    ListenPort=10052
    PidFile=/var/run/zabbix/zabbix_proxy_6/zabbix_proxy_6.pid
    DBName=/var/lib/zabbix-proxy/zabbix_proxy_6.db
    LogFile=/var/log/zabbix/zabbix_proxy_6.log
    SocketDir=/var/run/zabbix/zabbix_proxy_6

    Zabbix 5 conf:
    Server=<Zabbix Server 5.x IP>
    Hostname=<Zabbix Proxy 5.xHostname>
    ListenPort=10051
    PidFile=/var/run/zabbix/zabbix_proxy_5/zabbix_proxy_5.pid
    DBName=/var/lib/zabbix-proxy/zabbix_proxy_5.db
    LogFile=/var/log/zabbix/zabbix_proxy_5.log
    SocketDir=/var/run/zabbix/zabbix_proxy_5

    I have also created 2 service files for differentiating between the 2 zabbix proxy services and avoid conflict.
    While both proxy services are running normally, it appears that after installing zabbix proxy 6.4 on the VM, only this version actually works, the old Zabbix Proxy version stops sending statistics to the Zabbix 5 sever with no communication issues whatsoever.

    Im thinking maybe it has to do with the packages overwriting each other. Anyone ever done this successfully? Thanks in advance!
  • kyus
    Senior Member
    • Feb 2024
    • 171

    #2
    Have you tried installing both proxies as docker containers? (If that is a possibility...)

    Well, that's just a random suggestion... I've never setup such an environment so i really don't know whether or not it is possible to do it...

    Comment

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

      #3
      So you are trying to run 2 instances of v6.4 proxy in same host a and use one of them to feed v5 server? That will not work https://www.zabbix.com/documentation...zabbix-proxies And it probably also will not work vice versa, feedin 6.4 with v5 proxy... https://www.zabbix.com/documentation...zabbix-proxies
      If you want to run 2 different versions of proxy, you probably need to do a bit more to ensure that those 2 are both installed and newer will not overwrite files for older etc..

      Comment

      • d.skantzis
        Junior Member
        • Jan 2025
        • 6

        #4
        Ι actually want to do the latter. One proxy version 5.x feeding a Zabbix Server v5.x (which is already set up and working) and then another proxy v6.4 feeding a server version 6.4.
        I tried creating a separate service and changed all the necessary entries in the 6.4 proxy config file, but the newer version overwrites the older one.
        I would like to have both versions installed as separate packages and services,.

        Comment

        • Brambo
          Senior Member
          • Jul 2023
          • 245

          #5
          Maybe not the solution you are looking for but I know there is a 6.4 zabbix proxy docker container. This way you are sure it wont conflict.

          Comment

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

            #6
            Maybe running them from docker/podman might be easier...:P Otherwise you should make sure, both of versions get installed (probably some custom installation paths involved etc.. ), by default one would overwrite other as "upgrade".

            Comment

            • d.skantzis
              Junior Member
              • Jan 2025
              • 6

              #7
              I would like to avoid a dockerized solution as I have to apply this to over 50 VMs in my production environment so I would require something replicable. Is there a way to ensure that zabbix 6.4 is installed else and doesnt overwritte the default installation?

              Comment

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

                #8
                Originally posted by d.skantzis
                I would like to avoid a dockerized solution as I have to apply this to over 50 VMs in my production environment so I would require something replicable. Is there a way to ensure that zabbix 6.4 is installed else and doesnt overwritte the default installation?
                ugh.. 50 proxies is a lot.. But there are automation tools.. Ansible etc..

                But I would turn to your friendly linux admin with that particular question, how to install 2 separate instances of a package without "upgrade"..
                https://askubuntu.com/questions/1936...ocal-directory for example..

                Comment

                • PZakrzewski
                  Junior Member
                  • Dec 2024
                  • 12

                  #9
                  Hey,

                  Did you use a package manager to install both v5 and v6.4, or did you compile them from source?

                  Most package managers don’t allow multiple versions of the same software to coexist, as they tend to overwrite shared files. What you’re trying to achieve is technically possible, but it would require compiling one or both versions from source and customizing paths to avoid conflicts.

                  A simpler and more efficient solution would be to run one or both versions in Docker or Podman containers. This approach is particularly practical given that you mentioned needing to set up around 50 VMs with this configuration.

                  You could even use Ansible to automate the setup across all your VMs. As someone who works with containers daily, I can confidently say there’s no faster or easier way to deploy multiple services on the same host than using containers.

                  Comment

                  • d.skantzis
                    Junior Member
                    • Jan 2025
                    • 6

                    #10
                    Id be open to the idea of setting up the second proxy in a dockerized form, however as far as I can see, there are no zabbix proxy 6 docker images for Debian 10 (which most of my VMs run at), or am I missing something?

                    Comment

                    • kyus
                      Senior Member
                      • Feb 2024
                      • 171

                      #11
                      Hey!

                      Have you checked here?
                      Discover official Docker images from Zabbix SIA, a Verified Publisher on Docker Hub. Visit their profile and explore images they maintain.

                      Official Zabbix Dockerfiles. Contribute to zabbix/zabbix-docker development by creating an account on GitHub.

                      Comment

                      • d.skantzis
                        Junior Member
                        • Jan 2025
                        • 6

                        #12
                        While I know that dockers are a valid solution, I would prefer to avoid them for the time being. I have been scouring on how to install both V.5.0.45 and v.6.0 LTS of zabbix proxy on the same Debian VM without one interfering with the other (preventing packages from being upgraded and everything). If both are installed, I can then proceed to create 2 different proxy services with distinct conf,pid files and everything. My issue arises on how best to install both, not one and then upgrading its packages. Anyone have any ideas?

                        Comment

                        • d.skantzis
                          Junior Member
                          • Jan 2025
                          • 6

                          #13
                          Ok so I used the Docker solution as suggested, (honestly this was much easier to set up).
                          So currently I have:
                          Proxy 1: v.5 listening on port 10051 and forwarding to server v.5
                          Proxy 2 v.6 (Dockerised) listening on port 10052 and forwarding to server v.6.4

                          To my surprise, both servers were receiving metrics normally from the agents that were forwarding logs to the proxies without any configuration changes on the agent.conf file. How is it that the agent can forward metrics to both proxies (v.5 on 10051 and v.6 on 10052) without any input on my end?

                          Comment

                          • kyus
                            Senior Member
                            • Feb 2024
                            • 171

                            #14
                            Since the proxies are in the same VM, the agents are receiving connections from the same IP, so if they are passive agents they should be working just fine.

                            Now, you said that they're "forwarding" metrics to the proxies, so if they are active agents, you should need to add the proxy port in the agent config file

                            Comment

                            Working...