Zabbix-proxy package state



  • 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.


  • Rebel Alliance Developer Netgate

    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.



  • 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).


  • Rebel Alliance Developer Netgate

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


  • Rebel Alliance Developer Netgate

    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.



  • 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
    
    

  • Rebel Alliance Developer Netgate

    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.



  • 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 :)


  • Rebel Alliance Developer Netgate

    That would definitely explain it. :)

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



  • 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 :)


  • Rebel Alliance Developer Netgate

    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.



  • 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



  • @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.



  • 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


Log in to reply