Ad Widget

Collapse

Unable to compile 1.4.2 client on OS X

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wrd
    Junior Member
    • Sep 2007
    • 4

    #1

    Unable to compile 1.4.2 client on OS X

    On 10.4.10 Server, 10.4.8 Server, 10.4.6 Server, and 10.3.8 Server, configure runs fine, but make errors with:

    Code:
    /usr/bin/ld: Undefined symbols:
    _res_9_init
    _res_9_query
    collect2: ld returned 1 exit status
    make[2]: *** [zabbix_agent] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all-recursive] Error 1
    A coworker claims he had 1.1.x compiled and working correctly on OS X Server; I'm still looking into that, as I'm not entirely convinced it's true.

    Any suggestions would be appreciated. Thanks!
  • mduling
    Junior Member
    • Jun 2007
    • 7

    #2
    You need to pass -lresolv to the linker. I don't know when this became necessary. You may also use the Zabbix port in MacPorts.

    Comment

    • wrd
      Junior Member
      • Sep 2007
      • 4

      #3
      Thank you. I got that same information this morning from the DarwinPorts port maintainer. I am hoping to install the zabbix agent without installing the full ports collection, and it still doesn't seem to be building quite correctly. It's possible I didn't add the -lresolve correctly; I changed the following line in configure.in:

      [ LDFLAGS="${LDFLAGS} -static";

      To:

      [ LDFLAGS="${LDFLAGS} -static -lresolv";

      The software builds without any obvious errors now, but doesn't install anything, and I can't find any binaries in the source tree. I was only guessing on where to add -lresolv, so if I did that incorrectly, any tips would be appreciated. Thanks!

      Comment

      • mduling
        Junior Member
        • Jun 2007
        • 7

        #4
        Originally posted by wrd
        Thank you. I got that same information this morning from the DarwinPorts port maintainer. I am hoping to install the zabbix agent without installing the full ports collection, and it still doesn't seem to be building quite correctly. It's possible I didn't add the -lresolve correctly; I changed the following line in configure.in:

        [ LDFLAGS="${LDFLAGS} -static";

        To:

        [ LDFLAGS="${LDFLAGS} -static -lresolv";

        The software builds without any obvious errors now, but doesn't install anything, and I can't find any binaries in the source tree. I was only guessing on where to add -lresolv, so if I did that incorrectly, any tips would be appreciated. Thanks!
        I would encourage you to learn to use ports. It is easier to ask a port maintainer to add an option, or learn to hack portfiles yourself for custom situations that to manually install software. And your OSS doesn't pollute your OS. If you have your EDITOR variable set, just type "sudo port ed zabbix" and you'll be editing the Portfile. Remove the "dependency mysql5" text and also replace "--with-mysql=${prefix}/lib/mysql5/bin/mysql_config" with whatever is appropriate for your installation and that's it. If it works well I could add an "apple_mysql" variant or some such. To check for available variants:

        %port variants zabbix

        zabbix has the variants:
        universal
        server
        agent_only

        To install only the agent, use the "agent_only" variant:

        %sudo port -vd install zabbix +agent_only

        After install you may observe the files installed:

        %port contents zabbix

        Port zabbix contains:
        /Library/LaunchDaemons/org.macports.zabbix.plist
        /opt/local/etc/LaunchDaemons/org.macports.zabbix/org.macports.zabbix.plist
        /opt/local/etc/LaunchDaemons/org.macports.zabbix/zabbix.wrapper
        /opt/local/etc/zabbix/zabbix_agent.conf.sample
        /opt/local/etc/zabbix/zabbix_agentd.conf.sample
        /opt/local/sbin/zabbix/zabbix_agent
        /opt/local/sbin/zabbix/zabbix_agentd
        /opt/local/sbin/zabbix/zabbix_get
        /opt/local/sbin/zabbix/zabbix_sender
        /opt/local/share/zabbix/zabbix_agent_win32/zabbix_agentd.exe
        /opt/local/share/zabbix/zabbix_agentd.init


        If you really want to install it manually I can try to help offline, but I haven't installed software manually for over two years so I'm a little rusty.

        Comment

        • mduling
          Junior Member
          • Jun 2007
          • 7

          #5
          BTW, I was referring to MacPorts. DarwinPorts changed their names to MacPorts a while back. Their wiki has decent install docs. Just install a binary and set your path.

          Comment

          • mduling
            Junior Member
            • Jun 2007
            • 7

            #6
            Actually, you don't need to modify the MacPorts zabbix Portfile at all if you install the port using +agent_only. I was thinking of a zabbiz server install.

            Comment

            • wrd
              Junior Member
              • Sep 2007
              • 4

              #7
              Originally posted by mduling
              Actually, you don't need to modify the MacPorts zabbix Portfile at all if you install the port using +agent_only. I was thinking of a zabbiz server install.
              I was just about to post asking how to install agent only (it doesn't appear as a variant when I do port search zabbix), and here the question is already answered. Thanks very much!

              Comment

              • agehring
                Member
                • Oct 2006
                • 49

                #8
                How I did it...

                After a configure, I changed the Makefile LIBS entry to:

                LIBS = -lkvm -lm -lresolv -lz

                Compiles, and runs fine on my XServe/10.4.10

                Comment

                Working...