Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Zabbix-proxy package state

    Scheduled Pinned Locked Moved pfSense Packages
    14 Posts 3 Posters 13.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      IngmarHupp
      last edited by

      Hi - hope this is the right place for this. I've been in need of a zabbix-proxy (for monitoring devices on the inside of a site firewall from a central zabbix server in the "cloud") and noticed there was a zabbix_proxy package for my pfSense 1.2.3. Convenient! However, it doesn't seem to work:

      The database setting in the generated config file (/usr/local/etc/zabbix/zabbix_proxy.conf) points to a SQLite database path at /var/run/zabbix/proxy.db while the zabbix_proxy binary is built with MySQL database support instead of SQLite3 - so it just whinges about not being able to connect to the DB at startup. The package also seems to have a dependency on a MySQL client, but there's no trace of a MySQL server, nor is there any config in the GUI part for pointing the proxy to one (not that I would want that anyways, I'd much prefer SQLite as it's quite sufficient for the temporary data storage needs of a proxy and less bloated).

      Now I've messed around a bit and built a zabbix_proxy binary with SQLite support and dropped it in and it works just fine (although I had to add libsqlite.so and should probably get rid of the mysql client bits laying around uselessly on my install now). Any way this could be fixed in the "official" package? Or was it meant to have MySQL instead? If that's the case I'm going to have to roll my own, as I want one with SQLite for a variety of reasons.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        I don't have a Zabbix server to try against, but I also see the DB errors when trying to start. It's possible the binary just needs rebuilt with the proper dependencies and uploaded again.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • I
          IngmarHupp
          last edited by

          Thanks for confirming that. I've had a bit of time to poke around and now have a better understanding of how the pfSense packaging process works. If I can squeeze in some more time I'll build a fixed package with some improvements thrown in (also updating to Zabbix 1.8.3 as there were some significant improvements in that release).

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            I've got a new one building right now. I'll get it uploaded yet this afternoon.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              Ok, new binaries are up, and the package xml has been updated to look for 1.8.3. It should pull down sqlite and friends now.

              Give it a try and let me know what happens.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • I
                IngmarHupp
                last edited by

                Thanks, gave it a try. It does install (including sqlite libs etc.) but doesn't run. Apparently the libcurl isn't the right one (see below). Where it does get the info which libs to pull in anyways? There's no reference to libcurl/sqlite in the package xml as far as I can see.

                
                # etc/rc.d/zabbix_proxy.sh start
                Starting Zabbix Proxy...
                /libexec/ld-elf.so.1: /lib/libc.so.7: version FBSD_1.1 required by /usr/local/lib/libcurl.so.6 not found
                # ldd sbin/zabbix_proxy
                sbin/zabbix_proxy:
                        libsqlite3.so.8 => /usr/local/lib/libsqlite3.so.8 (0x280dd000)
                        libcurl.so.6 => /usr/local/lib/libcurl.so.6 (0x28158000)
                        libssl.so.5 => /usr/lib/libssl.so.5 (0x281a0000)
                        libcrypto.so.5 => /lib/libcrypto.so.5 (0x281e1000)
                        libz.so.4 => /lib/libz.so.4 (0x2833a000)
                        libm.so.5 => /lib/libm.so.5 (0x2834c000)
                        libkvm.so.4 => /lib/libkvm.so.4 (0x28361000)
                        libdevstat.so.6 => /lib/libdevstat.so.6 (0x28369000)
                        libnetsnmp.so.20 => /usr/local/lib/libnetsnmp.so.20 (0x28377000)
                        libelf.so.1 => /usr/lib/libelf.so.1 (0x2842f000)
                        libldap-2.4.so.7 => /usr/local/lib/libldap-2.4.so.7 (0x2844d000)
                        liblber-2.4.so.7 => /usr/local/lib/liblber-2.4.so.7 (0x28488000)
                        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28495000)
                        libc.so.7 => /lib/libc.so.7 (0x2858b000)
                # ls -l /lib/libc*
                -r-xr-xr-x  1 root  wheel  1026692 Jul 24  2009 /lib/libc.so.7
                
                
                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  The information is stored in the package file itself. Usually it pulls in all of the dependencies that it needs.

                  That actually looks like the curl library is OK but perhaps it was built against a newer version of FreeBSD than expected.

                  When I uploaded the zabbix proxy files again I skipped curl-7.20.1.tbz because it was already there. I replaced it this time, try to reinstall and see if the error persists.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • I
                    IngmarHupp
                    last edited by

                    Seems that version conflict was my bad actually, the box I used for testing was still on 1.2.3-RC3, after upgrading to 1.2.3-RELEASE libcurl was happy too (the Sept 10 dated libcurl package alone did not fix it).

                    Everything seems to be working fine now, it did create a SQLite DB as it should, although I'm not sure there's enough space in /var/run if you monitor a lot of items, but we'll see. I'll do some testing with this now and will report back soon. Thanks meanwhile :)

                    1 Reply Last reply Reply Quote 0
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      That would definitely explain it. :)

                      Be sure to post back after a while to let us know if it works ok.

                      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 0
                      • I
                        IngmarHupp
                        last edited by

                        I've made some changes to the package XML:

                        • Added fping path so ping monitors work (there's no fping6 binary around for IPv6 though)

                        • Moved database to /var/db/zabbix, as it grew to about 2MB (varying) with just a few monitored items

                        • Added Active/Passive mode switch and config frequency to GUI

                        • Fixed GUI default values

                        • Cleaner shutdown (kill Zabbix proxy pid instead of killall)

                        Patch here.

                        It's been running nice and smooth with these changes, although I've noticed that start/stop/restart on the Services GUI doesn't seem to work, although the rc.d/zabbix-proxy script does work fine - not sure why this is happening, unless the Services GUI is using some other way to control services? I plan to roll it out to a few more boxes soon. Thanks for the help :)

                        1 Reply Last reply Reply Quote 0
                        • jimpJ
                          jimp Rebel Alliance Developer Netgate
                          last edited by

                          I committed these changes to the repo. I made some minor formatting changes in one place, there were spaces where there should have been tabs, but otherwise it looked good.

                          I also made sure that the 2.0 versions of the pkg are up on 1.8.3 now as well, since the automated package builder finally cranked out the right binaries.

                          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                          Need help fast? Netgate Global Support!

                          Do not Chat/PM for help!

                          1 Reply Last reply Reply Quote 0
                          • P
                            patskoo
                            last edited by

                            Hi there,

                            I have some problem figuring out how to get zabbix proxy to work on my pfsense 1.2.3. I have tried to google for instruction to set up both Agent and Proxy for pfsense. I have no problem to get zabbix 1.83 appliance to find pfsense agent but I could not figure out why it could not see zabbix proxy on the same pfsense box (I use the newest zabbix proxy that it has gui to set proxy to run in passive mode)

                            Could you tell me how to configure zabbix proxy on pfsense? Can I install it together with Zabbix agent package? I have tried both zabbix proxy alone and zabbix proxy install with zabbix agent. I could not get the proxy to work either way.

                            Best Regards,

                            Pat

                            1 Reply Last reply Reply Quote 0
                            • I
                              IngmarHupp
                              last edited by

                              @patskoo:

                              Could you tell me how to configure zabbix proxy on pfsense? Can I install it together with Zabbix agent package? I have tried both zabbix proxy alone and zabbix proxy install with zabbix agent. I could not get the proxy to work either way.

                              Yes you can run it together with the agent. If you're using Zabbix proxy in passive mode (not recommended, but there may be valid reasons for doing so), the Zabbix server will need to be able to connect to it, which means you will need to adjust your pfSense rules to permit access to the proxy listening port on your pfSense box (from the Zabbix server).

                              In either mode you will also need to configure a proxy in Zabbix under Admin -> DM -> Proxies and the name there must match the name in the Zabbix Proxy GUI on pfSense. The proxy package on pfSense logs to /var/log/zabbix/, so that should be the first place to check what's going on.

                              1 Reply Last reply Reply Quote 0
                              • P
                                patskoo
                                last edited by

                                Many thanks for the instructions..!!! I have manager to get both the Zabbix Agent and Proxy to work. For the record, my pfsense box serve as Internet Proxy Server for each branches and each branches are connected bye a leased line. So I am doing active monitoring at the moment, I might consider doing passive monitoring in the future if there is an effect on Leased Line Load to and from each branches.

                                Best Regards,

                                Pat

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.