Ad Widget

Collapse

zabbix_server 1.8 - Oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mvrk
    Member
    • Oct 2008
    • 71

    #1

    zabbix_server 1.8 - Oracle

    Hi, i've installed zabbix 1.8, configured the oracle database, i can access the interface, all seems ok, but when i start the server i get this :

    [Z3001] Connection to database '//192.168.0.11/MYDB' failed: [-1]


    my zabbix_server.conf db settings:

    DBHost=192.168.0.11
    DBName=MYDB
    DBUser=zabbix
    DBPassword=xxxx

    I've got in my tnsnames.ora an entry called MYDB

    Anyone have any idea what could be the problema?
    Last edited by mvrk; 19-12-2009, 00:05.
  • mvrk
    Member
    • Oct 2008
    • 71

    #2
    I think the problem is this part of the code of zbx_db_connect


    if (host && *host) {
    connect = zbx_strdcatf(connect, "//%s", host);

    if (port)
    connect = zbx_strdcatf(connect, ":%d", port);
    }

    if (dbname && *dbname && connect) {
    if (connect)
    connect = zbx_strdcat(connect, "/");
    connect = zbx_strdcatf(connect, "%s", dbname);
    }

    If i define the DBHost it adds "//DBHost" to the connect string.

    If i don't define the DBHost, the connect string will be null because of this check: if (dbname && *dbname && connect)

    Shouldn't the only thing needed to connect to the oracle database be the name string defined in the tnsnames.ora ?

    Comment

    • coop
      Member
      • Aug 2009
      • 46

      #3
      Hey there! We're also running on Oracle for 1.8. We're currently using a 10.2 db so your setup could differ from ours.

      I noticed you said your Zabbix conf file was called zabbix_server.conf? May not mean anything however I was under the impression the system looks for zabbix.server.conf.... which is what ours is called.

      From what I can see in our settings (I'm not the DBA here) the zabbix.server.conf is more interested in the SID, not the TNS Name.

      Our TNS Name entry looks like this:

      ZABBIXPROD.world =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS =
      (COMMUNITY = tcp.world)
      (PROTOCOL = TCP)
      (Host = zabbix)
      (Port = 1549)
      )
      )
      (CONNECT_DATA = (SID = zabbix)(server=dedicated)
      )
      )

      And our zabbix.server.conf looks like this:

      $DB["TYPE"] = "ORACLE";
      $DB["SERVER"] = "10.2.2.26";
      $DB["PORT"] = "1549";
      $DB["DATABASE"] = "zabbix";
      $DB["USER"] = "zabbix";
      $DB["PASSWORD"] = "xxxxxx";
      $ZBX_SERVER = "localhost";
      $ZBX_SERVER_PORT = "10051";

      Not sure if that helps any.

      Comment

      • mvrk
        Member
        • Oct 2008
        • 71

        #4
        Mine is called zabbix.conf.php

        and i have this:

        $DB["TYPE"] = "ORACLE";
        $DB["SERVER"] = "192.168.0.11";
        $DB["PORT"] = "0";
        $DB["DATABASE"] = "MYDB";
        $DB["USER"] = "zabbix";
        $DB["PASSWORD"] = "zabbix69";
        $ZBX_SERVER = "localhost";
        $ZBX_SERVER_PORT = "10051";

        MYDB is the sid.

        but this configurations are for the web interface, and they are working fine.

        The problem is the server.

        What do you have on your zabbix_server.conf regarding the DBName, DBHost, DBPort parameters?

        Comment

        • coop
          Member
          • Aug 2009
          • 46

          #5
          Of course! Sorry, it's early in my morning here I was working on something frontend related and didn't think of the primary server config file.

          Here is the config from my zabbix_server.conf file. The only thing I see different between our setups in that I'm specifying the port....

          DBHost=10.2.2.26
          DBName=zabbix
          DBUser=zabbix
          DBPassword=xxxxxx
          DBPort=1549

          Comment

          • mvrk
            Member
            • Oct 2008
            • 71

            #6
            Still can't connect


            27698:20091221:141436.906 Starting zabbix_server. Zabbix 1.8 (revision 8565).
            27698:20091221:141436.906 **** Enabled features ****
            27698:20091221:141436.906 SNMP monitoring: YES
            27698:20091221:141436.906 IPMI monitoring: NO
            27698:20091221:141436.906 WEB monitoring: YES
            27698:20091221:141436.906 Jabber notifications: YES
            27698:20091221:141436.906 ODBC: YES
            27698:20091221:141436.906 SSH2 support: YES
            27698:20091221:141436.906 IPv6 support: NO
            27698:20091221:141436.906 **************************
            27698:20091221:141436.910 [Z3001] Connection to database '//192.168.0.11:1521/MYDB' failed: [-1]

            Comment

            • coop
              Member
              • Aug 2009
              • 46

              #7
              Stupid question, but can you confirm connection with those credentials and settings from something like sqlplus?

              Comment

              • mvrk
                Member
                • Oct 2008
                • 71

                #8
                Yes, i can connect with sqlplus, and also with zabbix web interface.

                Comment

                • fmtaylor2
                  Member
                  • May 2006
                  • 66

                  #9
                  I can confirm

                  I am having the exact same problem, so if I missed something let me know what it is....

                  Comment

                  • coop
                    Member
                    • Aug 2009
                    • 46

                    #10
                    Well I can confirm it is possible to get the connection up and running. The quality of that connection and all the bugs with Oracle are a whole other issue

                    Maybe we can start with stats and see where we get?

                    OS? Oracle version? OCI client files version? 32bit or 64bit? Is the database local to the Zabbix server or separate? Did you install from binary or compile manually?

                    I'm far from an expert on this so I can only offer up what it took us to get it working We're running 10.2 for DB and client locally on the same server as Zabbix to keep it "contained". I'm running on AIX 5.3 so I compile all my packages manually since finding PPC packages is a little tougher. I did have to get quite specific when compiling the Oracle portion of the server.

                    Comment

                    • fmtaylor2
                      Member
                      • May 2006
                      • 66

                      #11
                      more info

                      I am running RHEL5 x86_64
                      I had the oracle connection "working" under 1.6.8
                      I compiled 1.8 without errors.
                      I used the same config file as the 1.6.8 version for zabbix_server
                      I put the new 1.8 frontend in and had to change a line in db.inc to add the database name before it would work.

                      I have attached a bunch of "stuff" someone might find useful. It just makes my head hurt.

                      My dba says I should not need to use the host name and that it is all handled within the sql client software. But that does not work either....
                      Attached Files
                      Last edited by fmtaylor2; 21-12-2009, 21:42.

                      Comment

                      • mvrk
                        Member
                        • Oct 2008
                        • 71

                        #12
                        CentOS 5.4 (Kernel 2.6.18-128.1.6.el5.centos.plus)

                        32bit

                        Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
                        With the Partitioning, Real Application Clusters, OLAP, Data Mining
                        and Real Application Testing options

                        Client libs:
                        libocci.so -> libocci.so.10.1
                        libclntsh.so -> libclntsh.so.10.1

                        Dabase is running on same machine as zabbix server

                        I've compiled on my machine:

                        %configure \
                        --enable-server \
                        --enable-agent \
                        --enable-proxy \
                        --disable-ipv6 \
                        --with-oracle \
                        --with-oracle-include=/u01/app/oracle/product/10.2.0/db_1/rdbms/public \
                        --with-oracle-lib=/u01/app/oracle/product/10.2.0/db_1/lib \
                        --with-ssh2 \
                        --with-net-snmp \
                        --with-ldap \
                        --with-libcurl \
                        --with-jabber \
                        --with-unixodbc
                        Last edited by mvrk; 22-12-2009, 00:36.

                        Comment

                        • coop
                          Member
                          • Aug 2009
                          • 46

                          #13
                          Our environment is so different I'm trying to think if I have any info that can help. When I compiled I used the following:

                          ./configure --enable-server --with-oracle --with-net-snmp=/opt/freeware/bin/net-snmp-config --with-libcurl=/usr/local/bin/curl-config

                          For us Oracle 10.2 Enterprise was installed in 64bit so the 32bit client libraries were actually located at /oracle/app/oracle/10.2/lib32. The libraries under /oracle/app/oracle/10.2/lib were the 64bit libraries.

                          I modified my Configure script so that the oracle_lib_dir variable it uses pointed to $oracle_home/lib32 instead of $oracle_home/lib.

                          Code:
                          -rw-r--r--    1 oracle   dba        22101542 Apr 17 2008  libclntsh.a
                          lrwxrwxrwx   1 oracle   dba              17 Apr 17 2008  libclntsh.so -> libclntsh.so.10.1
                          -rwxr-xr-x   1 oracle   dba        21524889 Apr 17 2008  libclntsh.so.10.1
                          -rw-r--r--   1 oracle   dba               0 Jan 17 2007  libclntsh.so.10.1.ship
                          Are your LIBPATH and LD_LIBRARY_PATH variables set?

                          Comment

                          • mvrk
                            Member
                            • Oct 2008
                            • 71

                            #14
                            LIBPATH no
                            LD_LIBRARY_PATH yes

                            My env vars:

                            export ORACLE_BASE=/u01/app/oracle
                            export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
                            export ORACLE_SID=mydb
                            export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
                            Last edited by mvrk; 22-12-2009, 15:43.

                            Comment

                            • mvrk
                              Member
                              • Oct 2008
                              • 71

                              #15
                              I've managed to get a workaround, i've compiled the server again, but instead of compiling against oracle server libs, i've installed oracle instantclient and compiled against instant client libs, and it works now

                              Comment

                              Working...