Ad Widget

Collapse

cannot enable ODBC in Zabbix 3.0.3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yanngg
    Junior Member
    • Jul 2016
    • 8

    #1

    cannot enable ODBC in Zabbix 3.0.3

    Hi everyone,

    I'm having trouble in a new installation of zabbix 3.0.3 on a debian 8 64bit
    I configure with ODBC enabled, and also IPMI, SSH2 :

    Code:
    ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-openipmi  --with-libxml2  --with-ssh2 --with-unixodbc
    The output tells me that those features are enabled, but when I make install and then start the service, ODBC is not enabled, and it's confirmed by the logs.

    Does anybody have an idea to help me ?

    output of configure :
    Code:
    ...
    Configuration:
    
      Detected OS:           linux-gnu
      Install path:          /usr/local
      Compilation arch:      linux
    
      Compiler:              gcc
      Compiler flags:         -g -O2 -I/usr/include
    
      Library-specific flags:
        database:               -I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing    -g -DNDEBUG
        libXML2:               -I/usr/include/libxml2
        unixODBC:              -I/usr/include
        Net-SNMP:               -I/usr/local/include -I/usr/lib/x86_64-linux-gnu/perl/5.20/CORE -I. -I/usr/include
        OpenIPMI:              -I/usr/include
        libssh2:               -I/usr/include
    
      Enable server:         yes
      Server details:
        With database:         MySQL
        WEB Monitoring:        cURL
        Native Jabber:         no
        SNMP:                  yes
        IPMI:                  yes
        SSH:                   yes
        TLS:                   no
        ODBC:                  yes
        Linker flags:             -L/usr/lib/x86_64-linux-gnu      -L/usr/lib64  -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib    -L/usr/lib/x86_64-linux-gnu -rdynamic  -L/usr/lib64
        Libraries:               -lmysqlclient      -lxml2  -lodbc  -lnetsnmp -lssh2 -lOpenIPMI -lOpenIPMIposix    -lcurl -lodbc -lm -ldl  -lresolv -lodbc
    
      Enable proxy:          no
    
      Enable agent:          yes
      Agent details:
        TLS:                   no
        Linker flags:              -L/usr/lib/x86_64-linux-gnu -rdynamic  -L/usr/lib64
        Libraries:                 -lcurl -lodbc -lm -ldl  -lresolv -lodbc
    
      Enable Java gateway:   no
    
      LDAP support:          no
      IPv6 support:          yes
    
    ***********************************************************
    *            Now run 'make install'                       *
    *                                                         *
    *            Thank you for using Zabbix!                  *
    *              <http://www.zabbix.com>                    *
    ***********************************************************
    log file :

    Code:
    ...
     31356:20160720:122225.065 ****** Enabled features ******
     31356:20160720:122225.065 SNMP monitoring:           YES
     31356:20160720:122225.065 IPMI monitoring:            NO
     31356:20160720:122225.065 Web monitoring:            YES
     31356:20160720:122225.065 VMware monitoring:         YES
     31356:20160720:122225.065 SMTP authentication:       YES
     31356:20160720:122225.065 Jabber notifications:       NO
     31356:20160720:122225.065 Ez Texting notifications:  YES
     31356:20160720:122225.065 ODBC:                       NO
     31356:20160720:122225.065 SSH2 support:               NO
     31356:20160720:122225.065 IPv6 support:              YES
     31356:20160720:122225.065 TLS support:                NO
     31356:20160720:122225.065 ******************************
    ...
    Thanks
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Autoconf configure script shows line by line what kind of test is doing and result of those tests. In config.log file you have as well detailed kind of debug output generated by this script. All what you need to do i have look on output of configure and maybe into config.log around ding odbc library checks to figure out why autoconf decided to set up your source code without odbc support.
    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

    • yanngg
      Junior Member
      • Jul 2016
      • 8

      #3
      Hi kloczek
      Many thanks for answering me

      I checked the output of configure and saw no errors around odbc libraries,

      here is the odbc part of config.log :

      Code:
      configure:9582: checking for odbc_config
      configure:9600: found /usr/bin/odbc_config
      configure:9612: result: /usr/bin/odbc_config
      configure:9640: checking for SQLAllocHandle in -lodbc
      configure:9665: gcc -o conftest -g -O2 -I/usr/include  -rdynamic  -L/usr/lib64 conftest.c -lodbc  -lm -ldl  -lresolv -lodbc >&5
      configure:9665: $? = 0
      configure:9674: result: yes
      this and the output of configure makes me think everything goes OK for supporting ODBC
      but when I launch the server the odbc feature is disabled

      Comment

      • andris
        Zabbix developer
        • Feb 2012
        • 228

        #4
        Hi!

        If ODBC was successfully compiled in, there should be a line "#define HAVE_UNIXODBC 1" in include/config.h file. If it is not there, we have to investigate what failed in configure script (config.log), perhaps in m4/libunixodbc.m4.

        Sorry, no precise answer.

        Andris

        Comment

        • yanngg
          Junior Member
          • Jul 2016
          • 8

          #5
          Hi Andris

          thanks for your answer

          the line you mention is present in config.log :

          Code:
          ...
          #define ARCH "linux"
          #define SIZEOF_VOID_P 8
          #define HAVE_IPV6 1
          #define HAVE_MYSQL 1
          #define HAVE_MULTIROW_INSERT 1
          #define HAVE_LIBXML2 1
          #define HAVE_LIBODBC 1
          #define HAVE_UNIXODBC 1
          #define HAVE_LIBNETSNMP 1
          #define HAVE_NETSNMP_SESSION_LOCALNAME 1
          #define HAVE_NETSNMP 1
          #define HAVE_SSH2 1
          #define HAVE_OPENIPMI 1
          #define OPENIPMI_DEPRECATED 1
          #define HAVE_LIBCURL 1
          #define HAVE_FUNCTION_CURL_EASY_ESCAPE 1
          #define HAVE_LIBCURL 1
          ...
          ...and in include/config.h

          Code:
          /* Define to 1 if unixUNIXODBC Driver Manager should be used. */
          #define HAVE_UNIXODBC 1

          Yann
          Last edited by yanngg; 20-07-2016, 17:34. Reason: completed with include/config.h

          Comment

          • andris
            Zabbix developer
            • Feb 2012
            • 228

            #6
            Huhhh... If include/config.h contains line "#define HAVE_UNIXODBC 1" and "Enabled features" say "ODBC: NO", then it is a mystery. See src/zabbix_server/server.c how defined HAVE_UNIXODBC must lead to "ODBC: YES".

            Could it be that one Zabbix binary is compiled but some other is started ?

            Andris

            Comment

            • glebs.ivanovskis
              Senior Member
              • Jul 2015
              • 237

              #7
              Was compilation and installation successful? Are you launching the right binary?

              ./configure output and config.h contents do not match log output not just in ODBC aspect but also in SSH support.

              Comment

              • yanngg
                Junior Member
                • Jul 2016
                • 8

                #8
                Hi glebs.ivanovskis and Andris

                about being sure to use the good binary, I also had this doubt when I saw that several options were not matching between compilation and logs

                Today i did that (again) :
                - searched for binaries named "zabbix_server"
                - removed all those I found outside of sources directory

                -->
                Code:
                root@Zabbix3srv:/usr/local/sbin# find / -type f -name zabbix_server
                /usr/src/zabbix-3.0.3/src/zabbix_server/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/freebsd/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/tru64/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/fedora/core5/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/suse/9.2/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/suse/9.3/zabbix_server
                /usr/src/zabbix-3.0.3/misc/init.d/suse/9.1/zabbix_server
                - launched "./configure" and "make install"

                --> when I start the service I still have the same logs with no ODBC, no SSH2, no IPMI.

                am I missing something ?

                Yann

                Comment

                • andris
                  Zabbix developer
                  • Feb 2012
                  • 228

                  #9
                  ./configure .... arguments does not mention --prefix, where to install. Does "make install" result in installing a new Zabbix server binary into /usr/local/sbin/ ? Do you start it with /usr/local/sbin/zabbix_server .... ?

                  Andris

                  Comment

                  • yanngg
                    Junior Member
                    • Jul 2016
                    • 8

                    #10
                    Does "make install" result in installing a new Zabbix server binary into /usr/local/sbin/ ?
                    --> Yes

                    Do you start it with /usr/local/sbin/zabbix_server .... ?
                    --> In fact not exactly :

                    - I copy the binary generated to /usr/sbin,
                    - in /etc/init.d/zabbix-server I have "DAEMON=/usr/sbin/${NAME}"
                    - I launch the binary with "/etc/init.d/zabbix-server start"

                    do you think it can be a problem ?

                    Yann

                    Comment

                    • andris
                      Zabbix developer
                      • Feb 2012
                      • 228

                      #11
                      What does "ldd /usr/sbin/zabbix_server" show ?
                      Is there a line like "libodbc.so.2 => /usr/lib/x86_64-linux-gnu/libodbc.so.2 (0x00007fd776c8f000)" ?

                      Andris

                      Comment

                      • yanngg
                        Junior Member
                        • Jul 2016
                        • 8

                        #12
                        no there isn't :

                        Code:
                        root@Zabbix3srv:~# ldd /usr/sbin/zabbix_server
                                linux-vdso.so.1 (0x00007ffdc0f18000)
                                libmysqlclient.so.18 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 (0x00007f90d9cb5000)
                                libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f90d994e000)
                                libnetsnmp.so.30 => /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 (0x00007f90d966a000)
                                libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f90d93f6000)
                                libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f90d90f5000)
                                libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f90d8ef1000)
                                libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f90d8cda000)
                                libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f90d892f000)
                                libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f90d8712000)
                                libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f90d84f7000)
                                libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f90d81ec000)
                                libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f90d7fd6000)
                                liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f90d7db3000)
                                libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f90d79b7000)
                                libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f90d7783000)
                                librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f90d7565000)
                                libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f90d733c000)
                                libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f90d70db000)
                                libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f90d6e90000)
                                libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f90d6bbc000)
                                libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f90d698b000)
                                libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f90d6787000)
                                liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f90d6578000)
                                libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f90d6326000)
                                /lib64/ld-linux-x86-64.so.2 (0x00007f90da1f8000)
                                libgnutls-deb0.so.28 => /usr/lib/x86_64-linux-gnu/libgnutls-deb0.so.28 (0x00007f90d6007000)
                                libhogweed.so.2 => /usr/lib/x86_64-linux-gnu/libhogweed.so.2 (0x00007f90d5dd8000)
                                libnettle.so.4 => /usr/lib/x86_64-linux-gnu/libnettle.so.4 (0x00007f90d5ba6000)
                                libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f90d5923000)
                                libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f90d5641000)
                                libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f90d5435000)
                                libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f90d5231000)
                                libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f90d5015000)
                                libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f90d4dcf000)
                                libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f90d4bbb000)
                                libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f90d49a9000)
                                libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f90d47a1000)

                        Comment

                        • andris
                          Zabbix developer
                          • Feb 2012
                          • 228

                          #13
                          "ldd" output also shows no ipmi library is required. That does not go together with "IPMI: yes" in "./configure" output and successful starting of binary. I would thoroughly investigate what is compiled, installed and started - is it the same binary. How it goes if you start it manually: /usr/local/sbin/zabbix_server .... instead of from init script ?

                          Andris

                          Comment

                          • yanngg
                            Junior Member
                            • Jul 2016
                            • 8

                            #14
                            How it goes if you start it manually: /usr/local/sbin/zabbix_server .... instead of from init script ?
                            --> the result is the same

                            Comment

                            • yanngg
                              Junior Member
                              • Jul 2016
                              • 8

                              #15
                              [solved]

                              I decided to remove all my source dir (/usr/src/zabbix-3.0.3/), extracted it again and restarted all the ./configure and make install process

                              I could see then that I had a really bigger output during the make install process than the other times, and the binary generated is now exactly the one I expected :

                              Code:
                               11523:20160721:144019.650 ****** Enabled features ******
                               11523:20160721:144019.650 SNMP monitoring:           YES
                               11523:20160721:144019.650 IPMI monitoring:           YES
                               11523:20160721:144019.650 Web monitoring:            YES
                               11523:20160721:144019.650 VMware monitoring:         YES
                               11523:20160721:144019.650 SMTP authentication:       YES
                               11523:20160721:144019.650 Jabber notifications:       NO
                               11523:20160721:144019.650 Ez Texting notifications:  YES
                               11523:20160721:144019.650 ODBC:                      YES
                               11523:20160721:144019.650 SSH2 support:              YES
                               11523:20160721:144019.650 IPv6 support:              YES
                               11523:20160721:144019.650 TLS support:                NO
                              thank you Andris, glebs.ivanovskis and kloczek for your help !

                              Comment

                              Working...