Ad Widget

Collapse

Compilation error on Solaris 11.3 with Zabbix 3.4.11 and MySQL 5.7.13

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danielh
    Junior Member
    • Jun 2018
    • 3

    #1

    Compilation error on Solaris 11.3 with Zabbix 3.4.11 and MySQL 5.7.13

    Hello everyone,

    I'm trying to compile Zabbix server 3.4.11 for Solaris 11.3 64-bit (i386) with a custom MySQL installation of version 5.7.13 with these settings
    Code:
    CFLAGS="-m64" CPPFLAGS="-I/opt/mysql/include" LDFLAGS="-L/opt/mysql/lib" ./configure --prefix=/opt/zabbix --enable-server --with-mysql=/opt/mysql-5.7.13-solaris11-x86_64 --with-openssl --with-ldap --with-libcurl --with-libxml2 --with-libpcre=/opt/zabbix --sysconfdir=/opt/etc/zabbix --with-net-snmp --with-ssh2
    The configure itself went without an issue
    Code:
    Configuration:
    
      Detected OS:           solaris2.11
      Install path:          /opt/zabbix
      Compilation arch:      solaris
    
      Compiler:              gcc
      Compiler flags:         -m64 -m64 -I/opt/zabbix/include
    
      Library-specific flags:
        database:                  
        libXML2:               -I/usr/include/libxml2
        Net-SNMP:               -I. -I/usr/include
        libssh2:               -I/usr/include
        TLS:                   -I/usr/include
        LDAP:                  -I/usr/include
    
      Enable server:         yes
      Server details:
        With database:         MySQL
        WEB Monitoring:        cURL
        Native Jabber:         no
        SNMP:                  yes
        IPMI:                  no
        SSH:                   yes
        TLS:                   OpenSSL
        ODBC:                  no
        Linker flags:                    -L/usr/lib -L/usr/lib   -L/usr/lib -L/usr/lib  -rdynamic -L/opt/mysql/lib -L/opt/zabbix/lib
        Libraries:                    -lxml2    -lnetsnmp -lssh2  -levent -lssl -lcrypto -lldap -llber   -lcurl -lidn -lssh2 -lssh2 -lnsl -lsocket -lssl -lcrypto -lssl -lcrypto -lgss -llber-2.4 -lldap_r-2.4 -lz -lsocket -lnsl -lkvm -lm -lnsl -lkstat -lsocket  -lresolv -lpcreposix -lpcre
    
      Enable proxy:          no
    
      Enable agent:          no
    
      Enable Java gateway:   no
    
      LDAP support:          yes
      IPv6 support:          no
    
    ***********************************************************
    *            Now run 'make install'                       *
    *                                                         *
    *            Thank you for using Zabbix!                  *
    *              <http://www.zabbix.com>                    *
    ***********************************************************
    but once I get to the "make" step symbol referencing errors are thrown when referencing the zbxdb files
    Code:
    gmake[3]: Entering directory `/data/building/source/zabbix/zabbix-3.4.11/zabbix-3.4.11/src/zabbix_server'
    gcc -DZABBIX_DAEMON -DSYSCONFDIR="\"/opt/etc/zabbix\"" -DDATADIR="\"/opt/zabbix/share\"" -DLIBDIR="\"/opt/zabbix/lib\"" -I../../src/libs/zbxdbcache  -m64 -m64 -I/opt/zabbix/include -L/usr/lib -L/usr/lib   -L/usr/lib -L/usr/lib  -rdynamic -L/opt/mysql/lib -L/opt/zabbix/lib  -o zabbix_server zabbix_server-actions.o zabbix_server-operations.o zabbix_server-events.o zabbix_server-server.o  alerter/libzbxalerter.a dbsyncer/libzbxdbsyncer.a dbconfig/libzbxdbconfig.a discoverer/libzbxdiscoverer.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a timer/libzbxtimer.a trapper/libzbxtrapper.a snmptrapper/libzbxsnmptrapper.a httppoller/libzbxhttppoller.a escalator/libzbxescalator.a proxypoller/libzbxproxypoller.a selfmon/libzbxselfmon.a vmware/libzbxvmware.a taskmanager/libzbxtaskmanager.a scripts/libzbxscripts.a preprocessor/libpreprocessor.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxhistory/libzbxhistory.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxregexp/libzbxregexp.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxmedia/libzbxmedia.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxhttp/libzbxhttp.a ../../src/libs/zbxipcservice/libzbxipcservice.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbupgrade/libzbxdbupgrade.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a ../../src/libs/zbxmodules/libzbxmodules.a ../../src/libs/zbxtasks/libzbxtasks.a  -lxml2    -lnetsnmp -lssh2  -levent -lssl -lcrypto -lldap -llber   -lcurl -lidn -lssh2 -lssh2 -lnsl -lsocket -lssl -lcrypto -lssl -lcrypto -lgss -llber-2.4 -lldap_r-2.4 -lz -lsocket -lnsl  -lkvm -lm -lnsl -lkstat -lsocket  -lresolv -lpcreposix -lpcre
    Undefined                       first referenced
     symbol                             in file
    mysql_fetch_row                     ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_set_character_set             ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_query                         ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_errno                         ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_error                         ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_close                         ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_options                       ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_free_result                   ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_next_result                   ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_store_result                  ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_init                          ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_select_db                     ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_affected_rows                 ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_real_connect                  ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_field_count                   ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    mysql_autocommit                    ../../src/libs/zbxdb/libzbxdb.a(libzbxdb_a-db.o)
    ld: fatal: symbol referencing errors
    collect2: error: ld returned 1 exit status
    gmake[3]: *** [zabbix_server] error 1
    gmake[3]: Leaving directory `/data/building/source/zabbix/zabbix-3.4.11/zabbix-3.4.11/src/zabbix_server'
    gmake[2]: *** [all-recursive] error 1
    gmake[2]: Leaving directory `/data/building/source/zabbix/zabbix-3.4.11/zabbix-3.4.11/src/zabbix_server'
    gmake[1]: *** [all-recursive] error 1
    gmake[1]: Leaving directory `/data/building/source/zabbix/zabbix-3.4.11/zabbix-3.4.11/src'
    Is this a known issue or is there a way I can get around this?

    Thank you very much.
    Regards,
    Daniel
  • kernbug
    Senior Member
    • Feb 2013
    • 330

    #2
    Originally posted by danielh
    Hello everyone,

    Is this a known issue or is there a way I can get around this?
    Hi,

    Bad library order, please check LDFLAGS.

    Comment

    • danielh
      Junior Member
      • Jun 2018
      • 3

      #3
      Hi,

      sometimes you don't see the forest for the trees. After fiddling around with the LDFLAGS and finally getting to this
      Code:
      LDFLAGS="-g -m64 -L/opt/mysql/lib -R/opt/mysql/lib -I/opt/mysql/include"
      everything is working as expected

      Thank you very much for pointing to the right direction.
      Regards,
      Daniel

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by danielh
        Hello everyone,

        I'm trying to compile Zabbix server 3.4.11 for Solaris 11.3 64-bit (i386) with a custom MySQL installation of version 5.7.13 with these settings
        Code:
        CFLAGS="-m64" CPPFLAGS="-I/opt/mysql/include" LDFLAGS="-L/opt/mysql/lib" ./configure --prefix=/opt/zabbix --enable-server --with-mysql=/opt/mysql-5.7.13-solaris11-x86_64 --with-openssl --with-ldap --with-libcurl --with-libxml2 --with-libpcre=/opt/zabbix --sysconfdir=/opt/etc/zabbix --with-net-snmp --with-ssh2
        Daniel
        Here is the problem:
        I'm just looking on my zabbix.spec which can be used to build and publish to IPS repository zabbix package (using pkgtool perl script). Some fragments from this spec:

        Code:
        %ifos solaris then
        %define                 mysql_config    =%{_prefix}/mysql/5.6/bin/mysql_config
        %else
        %define                 mysql_config    ""
        %endif
        
        [..]
        
        %build
        autoreconf -iv
        %define _configure      ../configure
        mkdir build_mysql
        cd build_mysql
        %configure \
                LDFLAGS="%{build_ldflags} -Wl,--as-needed %{?with_lto:-flto -fuse-linker-plugin}" \
                CFLAGS="%{optflags} %{?with_lto:-flto}" \
                %{?with_lto:AR="gcc-ar" RANLIB="gcc-ranlib" NM="gcc-nm"} \
                --enable-agent \
                --enable-ipv6 \
                --enable-proxy \
                --enable-server \
                --with%{!?with_jabber:out}-jabber \
                --%{?with_java:en}%{!?with_java:dis}able-java \
                --with-ldap \
                --with-libcurl \
                --with-libxml2 \
                --with-net-snmp \
                --with%{!?with_openipmi:out}-openipmi \
                --with-openssl \
                --with%{!?with_mysql:out}-mysql%{mysql_config} \
                --with%{!?with_pgsql:out}-postgresql \
                --with%{!?with_oracle:out}-oracle \
                --with%{!?with_odbc:out}-unixodbc \
                %{nil}
        %{make_build} ZABBIX_VERSION_PATCH="%{version}-%{release}"
        In other words because on Solaris it is possible install and use more than one version of the MySQL client library and its devel resources you need to pass to configure:

        Code:
        --with-mysql==/usr/mysql/<Major.Version>/bin/mysql_config
        As well you don't need to use any custom packages installed in /opt to use zabbix because all what you need is to install few packages and enable devel facet ("pkg change-facet facet.devel=true').
        After finish building zabbix package to remove from the system all devel stuff all what you need to do is execute one more time pkg to disable devel facet ("pkg change-facet facet.devel=false").

        At the moment I have not access to Solaris however I have SMF manifests and backend scripts to allow manage zabbix services using SMF.
        If you want I can share those resources.
        Few things are still missing in my zabbix.spec and SMF manifest but to finish those bits which are still missing I'll need access to some Solaris system with enabled devel facet, installed mysql (5.7) and given priviledges to be able restart three zabbix services (On Solaris is possible to give such privs to non-root user).
        If someone can provide access to such system (best as zone ) please contact me on <[email protected]> to discuss details.
        I would be glad to finish few still missing things (like creating SMF instances of zabbix services and mapping all zabbix configuration parameters usualuy stored in .conf files to SMF service variables to be able change configuration of the zabbix services not by fidling in .conf ciles but by use svccfg/svcprop commands)

        BTW you may have look on my OS Solaris template which has implemented zpools health, zfs volumes usage, block devices IO stats, ARC and L2ACR monitoring (all using LLDs).
        https://github.com/kloczek/zabbix-te...r/OS%20Solaris
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • danielh
          Junior Member
          • Jun 2018
          • 3

          #5
          Yeah, the main problem was a wrong "LDFLAG"-parameter floating around in my ENV. After fixing that I was able to compile Zabbix
          Code:
          CFLAGS="-g -m64 -I/opt/mysql/include -I/opt/mysql/lib -L/opt/mysql/lib -R/opt/mysql/lib -L/opt/mysql/include -R/opt/mysql/include" LDFLAGS="-g -m64 -L/opt/mysql/lib -R/opt/mysql/lib -I/opt/mysql/include" CXXFLAGS="-m64" ./configure --prefix=/opt/zabbix --enable-server --enable-agent --sysconfdir=/opt/etc/zabbix --with-mysql=/opt/mysql --with-openssl --with-ldap --with-libcurl --with-libxml2 --with-libpcre=/opt/zabbix --with-net-snmp --with-ssh2
          We use some custom MySQL package therefore the reference to /opt.

          At the moment I have two SMF services (one for the server and one for the agent) but without managing the configuration parameters through service variables (still .conf at the moment)
          Server-SMF:
          Code:
          <?xml version='1.0'?>
          <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
          <service_bundle type='manifest' name='export'>
            <service name='application/zabbix-server' type='service' version='0'>
              <dependency name='network' grouping='require_all' restart_on='none' type='service'>
                <service_fmri value='svc:/milestone/network:default'/>
              </dependency>
              <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
                <service_fmri value='svc:/system/filesystem/local:default'/>
              </dependency>
              <exec_method name='start' type='method' exec='/opt/zabbix/sbin/server.sh' timeout_seconds='60'>
                <method_context/>
              </exec_method>
              <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'>
                <method_context/>
              </exec_method>
              <instance name='default' enabled='true'>
                <method_context project=':default' resource_pool=':default' working_directory='/opt/zabbix'>
                  <method_credential group='zabbix' limit_privileges=':default' privileges=':default' supp_groups=':default' user='zabbix'/>
                </method_context>
                <property_group name='zabbix' type='application'>
                  <propval name='bin' type='astring' value='/opt/zabbix/sbin'/>
                </property_group>
                <property_group name='general' type='framework'>
                  <propval name='action_authorization' type='astring' value='solaris.smf.manage.zabbix'/>
                  <propval name='value_authorization' type='astring' value='solaris.smf.value.zabbix'/>
                </property_group>
              </instance>
              <stability value='Evolving'/>
              <template>
                <common_name>
                  <loctext xml:lang='C'>Zabbix Monitoring software</loctext>
                </common_name>
                <documentation>
                  <manpage title='Zabbix' section='1'/>
                  <doc_link name='zabbix.com' uri='http://www.zabbix.com'/>
                </documentation>
              </template>
            </service>
          </service_bundle>
          "/opt/zabbix/sbin/server.sh"
          Code:
          #!/bin/bash
          
          export LD_LIBRARY_PATH=/opt/zabbix/lib:$LD_LIBRARY_PATH; /opt/zabbix/sbin/zabbix_server -c /opt/etc/zabbix/zabbix_server.conf
          Agent-SMF:
          Code:
          <?xml version='1.0'?>
          <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
          <service_bundle type='manifest' name='export'>
            <service name='application/zabbix-agent' type='service' version='0'>
              <dependency name='network' grouping='require_all' restart_on='none' type='service'>
                <service_fmri value='svc:/milestone/network:default'/>
              </dependency>
              <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'>
                <service_fmri value='svc:/system/filesystem/local:default'/>
              </dependency>
              <exec_method name='start' type='method' exec='/opt/zabbix/sbin/agent.sh' timeout_seconds='60'>
                <method_context/>
              </exec_method>
              <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'>
                <method_context/>
              </exec_method>
              <instance name='default' enabled='true'>
                <method_context project=':default' resource_pool=':default' working_directory='/opt/zabbix'>
                  <method_credential group='zabbix' limit_privileges=':default' privileges=':default' supp_groups=':default' user='zabbix'/>
                </method_context>
                <property_group name='zabbix' type='application'>
                  <propval name='bin' type='astring' value='/opt/zabbix/sbin'/>
                </property_group>
                <property_group name='general' type='framework'>
                  <propval name='action_authorization' type='astring' value='solaris.smf.manage.zabbix'/>
                  <propval name='value_authorization' type='astring' value='solaris.smf.value.zabbix'/>
                </property_group>
              </instance>
              <stability value='Evolving'/>
              <template>
                <common_name>
                  <loctext xml:lang='C'>Zabbix Monitoring software</loctext>
                </common_name>
                <documentation>
                  <manpage title='Zabbix' section='1'/>
                  <doc_link name='zabbix.com' uri='http://www.zabbix.com'/>
                </documentation>
              </template>
            </service>
          </service_bundle>
          "/opt/zabbix/sbin/agent.sh"
          Code:
          #!/bin/bash
          
          export LD_LIBRARY_PATH=/opt/zabbix/lib:$LD_LIBRARY_PATH; /opt/zabbix/sbin/zabbix_agentd -c /opt/etc/zabbix/zabbix_agentd.conf
          I will have a look on your template. Seems very useful on a first glance.

          Regards,
          Daniel

          Comment


          • iav
            iav commented
            Editing a comment
            Where is correct place for agent smf.xml file?

          • danielh
            danielh commented
            Editing a comment
            Doesn't really matter where you place this file, as you can import it using "/usr/sbin/svccfg import *Path to smf.xml*"
        • kloczek
          Senior Member
          • Jun 2006
          • 1771

          #6
          Originally posted by danielh
          We use some custom MySQL package therefore the reference to /opt.
          IMO doing this is pointless.
          Really OOTB MySQL is OK and additionally it has DTrace support compiled in.
          In case any issues with distro MySQL you can raise Oracle SR.
          http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
          https://kloczek.wordpress.com/
          zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
          My zabbix templates https://github.com/kloczek/zabbix-templates

          Comment

          Working...