Ad Widget

Collapse

Bypass proxy using zabbix sender

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • douglaz
    Junior Member
    • May 2009
    • 9

    #1

    Bypass proxy using zabbix sender

    I want to send a item directly to server using zabbix sender, but the host is configured to use a proxy. I tried and it fails. There is some way to do that?
  • mushero
    Senior Member
    • May 2010
    • 101

    #2
    We also REALLY need this - we have lots of proxies but also some central things like syslog scanning so we need to send info via sender to the central zabbix server for any host, even if that host is on a proxy.

    Seems the server will only data for a given host on a proxy from that proxy.

    We've looked at changing the source to allow this, though having a bit of trouble finding where this check is done, and also any risks of this.

    After a quick look, maybe get_proxy_id() is failing if proxy doesn't match.

    Or process_trap() is failing somewhere, or maybe function get_proxy_id() in proxy.c is not returning a valid ID.

    We can trace/dig more but hopefully someone can tell us where we can relax this constraint so we can send data on any host.

    Comment

    • MaxM
      Member
      • Sep 2011
      • 42

      #3
      You can use zabbix sender to send as *any* host. E.g. if I'm on the machine foo, I can send as if I were on bar using zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -s foo -k mysql.queries -o 342.45

      You can then restrict who can send where using the Allowed Host field on a trapper item (which you can set to a macro value, then set a macro on each host using the API)

      Comment

      • tsalle
        Member
        Zabbix Certified Specialist
        • Oct 2012
        • 79

        #4
        send data to proxy

        Hi,
        You can also send data to the proxy.
        The proxy will then forward received data to the zabbix server.

        zabbix_sender -z <zabbix proxy>

        Comment

        • mushero
          Senior Member
          • May 2010
          • 101

          #5
          That's what we do today (send to proxy) - we want to bypass this as we have proxies all over the world, but want to send directly to the central server, bypassing the proxy. Today the server rejects these because that host is handled by the proxy.

          Comment

          • bbrendon
            Senior Member
            • Sep 2005
            • 870

            #6
            Any updates on this? I was thinking about doing sql inserts directly but I'm not sure if that will bypass triggers.
            Unofficial Zabbix Expert
            Blog, Corporate Site

            Comment

            • mushero
              Senior Member
              • May 2010
              • 101

              #7
              Unfortunately you can't do this or you will miss the triggers and also I think have problems with IDs which are generated in the server.

              Basically triggers are evaluated in the server during the DB storage process, so you can't bypass this.

              We are working on patches for 2.4 on this, but the way items are cached and looked up in the relevant function changed from 2.2 to 2.4.

              We should have a patch ready this month.

              Comment

              • wamsterdam
                Member
                • Apr 2013
                • 34

                #8
                Any update on this one? I have a script running on my zabbix server which processes mail from a imap mailbox. The script uses zabbix_sender to update specific hosts. Some hosts are monitored by zabbix server directly, some are monitored by proxies. I need to be able to update all hosts via this script.

                TIA,
                Wouter

                Comment

                • mushero
                  Senior Member
                  • May 2010
                  • 101

                  #9
                  Yes, we have a patch for 2.4 which turned out to be different and much simpler than what we had to do for 1.8

                  Looking at our Git system, would seem following - let me know if not clear as been a long while since I've looked at this - basic idea is to get server to ignore fact that this host is not directly monitored for any trapper item:

                  Change is in zabbix-2.4.1/src/libs/zbxdbhigh/proxy.c (see the - and + for diff changes)

                  if (SUCCEED != errcodes[i])
                  continue;

                  - if (proxy_hostid != items[i].host.proxy_hostid)
                  + if (ITEM_TYPE_TRAPPER != items[i].type && proxy_hostid != items[i].host.proxy_hostid)
                  continue;

                  if (ITEM_STATUS_ACTIVE != items[i].status)

                  Comment

                  • wamsterdam
                    Member
                    • Apr 2013
                    • 34

                    #10
                    OK, thanks. I will give that a try. This will be overwritten when I update zabbix server, right? I was already rewriting my script to retrieve the IP address/DNS name of the configured proxy for each host. Turned out I had to switch from active proxy to passive proxy to be able to set an IP address for the proxy. This changed and a firewall rule added at the remote site, enabled using zabbix_sender through the remote proxy.

                    TIA,
                    Wouter

                    Comment

                    • mushero
                      Senior Member
                      • May 2010
                      • 101

                      #11
                      Originally posted by wamsterdam
                      OK, thanks. I will give that a try. This will be overwritten when I update zabbix server, right?
                      Yes, suggest you update to latest server version first, 2.4.x even if GUI and agents are older, so you don't have to upgrade for a while.

                      Comment

                      • fbeuserie@gmail.com
                        Junior Member
                        • Mar 2009
                        • 2

                        #12
                        Hello, i'm facing the same use case as some of you, need to send trappers to an host by addressing the zabbix server directly, but to an host attached to a proxy.

                        Someone can confirm there is a working solution in recent version ? (we are running 3.14 here). thks

                        Comment

                        • code-
                          Junior Member
                          • Sep 2020
                          • 1

                          #13
                          Is there still no official solution to this?

                          Comment

                          • vecheria
                            Junior Member
                            • Jul 2024
                            • 1

                            #14
                            I also need it, but bypassing doesn't work

                            Comment

                            • simonl
                              Junior Member
                              • Apr 2021
                              • 11

                              #15
                              A new feature in Zabbix 7.0 is the ability to push item data into the database directly via the API without going via the proxy (history.push method?).
                              Perhaps that's an alternative option to using zabbix_sender.

                              Comment

                              Working...