Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #108] IDOUtils with Oracle #36

Closed
icinga-migration opened this issue May 26, 2009 · 7 comments
Closed

[dev.icinga.com #108] IDOUtils with Oracle #36

icinga-migration opened this issue May 26, 2009 · 7 comments

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/108

Created by mfriedrich on 2009-05-26 12:46:05 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2009-10-19 16:54:42 +00:00)
Target Version: 1.0 RC1
Last Update: 2009-10-19 16:54:42 +00:00 (in Redmine)


  • Test the libdbi against Oracle (libdbi-drivers from CVS and Oracle Instant Client+SDK)
  • Merge Code from NDOUtils Oracle with current IDOUtils Implementation (libdbi instead of liboci)
  • Improve current Queries/Code
  • Take care of Multi-DB support (switch case at non-normalized queries)
  • Provide Install Howtos

Sources:
http://www.mare-system.de/dev/icinga\_installation.html
https://www.nagiosforge.org/gf/project/ndoutils\_oracle/


Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-06-08 16:21:27 +00:00

dnsmichi wrote:

* Test the libdbi against Oracle (libdbi-drivers from CVS and Oracle Instant Client+SDK)

Using the listing of the supported drivers it's easier to grep errors testing libdbi-oracle.

Following describes in short an install of the libdbi for oracle on RHEL x64. Debian should be the same.

1.) Get Oracle Instantclient AND the SDK (which includes oci.h). Depending on your architecture, x86 or x64. Oracle requires an account for downloading.

cd /opt/
unzip instantclient-basic-linux32-11.1.0.7.zip
unzip instantclient-sdk-linux32-11.1.0.7.zip
mv instantclient_11_1 oracle_instantclient_11_1

A softlink is missing otherwise make of libdbi-drivers will fail.

cd /opt/oracle_instantclient_11_1/
ln -s libclntsh.so.11.1 libclntsh.so

2.) Install the libdbi. Either you install it from repo or you build it yourself by using the tar-ball or cvs-snapshot.

Make sure, you run configure with --disable-docs because make could fail on sqml2pdf-format.

On some systems, it is required to install the libdbi in /usr/lib instead of /usr/local/bin. For that use --prefix=/usr while configure.

3.) libdbi for Oracle is still experimential and cannout be installed from repo. Therefore get the tar-ball or the cvs snapshot. I've experienced automake errors on RHEL x64 while the source from the tarball contains a src typo.

vim drivers/oracle/dbd_oracle.c
:844 uncomment the line
/*  time_t  loct = 0L; */

Then tell configure where the oracle libs from the instant client can be found (or the DB in any case you are really using Icinga and Oracle on one server...)

./configure --with-oracle 
--with-oracle-libdir=/opt/oracle_instantclient_11_1 
--with-oracle-incdir=/opt/oracle_instantclient_11_1/sdk/include 
--disable-docs

In case set the prefix. If you are compiling on x64, make install could copy the libs to the wrong location. Solution is to copy them manually to /usr/lib64/dbd/ (where libdbmysql is installed by default) and run ldconfig.

4.) Test if the driver is loaded correctly. Used a local GIT branch in module/idoutils and shot the cmd

./src/ido2db -c ./config/ido2db.cfg

If there's no error, ido2db should be running.


Next steps are to test the db connection and submit queries.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-06-09 14:03:08 +00:00

  • Target Version set to 0.8.2
  • Done % changed from 0 to 10

dnsmichi wrote:

Next steps are to test the db connection and submit queries.

This is far too fast right now...

I've installed a fresh Icinga with IDOUtils on a testbox, setting the same configs like for ndoutils oracle, only a missing db schema (for testing purposes).

Starting up IDO and Icinga, and looking into /var/log/messages (ido2db.debug doesn't clearly show the error) for the "connection there but schema not found"-error. And it is there, meaning DB connection through libdbi with Oracle is working fine.

Jun  9 14:54:04 nagios-test icinga: Icinga 0.8 starting... (PID=11154)
Jun  9 14:54:04 nagios-test icinga: Local time is Tue Jun 09 14:54:04 CEST 2009
Jun  9 14:54:04 nagios-test icinga: LOG VERSION: 2.0 
Jun  9 14:54:04 nagios-test icinga: idomod: NDOMOD 1.4b8 (01-03-2009) Copyright (c) 2005-2008 Ethan Gal
stad (nagios@nagios.org), Copyright (c) 2009 Icinga Development Team (http://www.icinga.org))
Jun  9 14:54:04 nagios-test icinga: idomod: Successfully connected to data sink.  0 queued items to flu
sh.
Jun  9 14:54:04 nagios-test icinga: Event broker module '/usr/local/icinga/bin/idomod.o' initialized su
ccessfully.
Jun  9 14:54:04 nagios-test icinga: Finished daemonizing... (New PID=11156) 
Jun  9 14:54:05 nagios-test ido2db: Successfully connected to database
Jun  9 14:54:05 nagios-test ido2db: Error: database query failed for 'SELECT instance_id FROM icinga_in
stances WHERE instance_name='default'' - '942: ORA-00942: table or view does not exist ' 
Jun  9 14:54:05 nagios-test ido2db: Successfully disconnected from database

So it works, but before issuing queries, I need to develop a matching DB schema because Oracle limits table names to a maximum of 30 characters -> varchar2(30).

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-06-19 09:06:26 +00:00

  • Status changed from New to Assigned
  • Target Version deleted 0.8.2
  • Done % changed from 10 to 0

The Oracle driver of libdbi throws address mapping exceptions on Oracle 11g RDBM - on the libdbi-mailinglist, Markus Hoenicka said that the driver has not been developed on since 1 year.
So by using the libdbi as abstraction layer, there is the need of a rewritten/new Oracle driver for libdbi. As far as I have looked at, this will take longer than expected so I have to postpone the target release for that.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-08-29 13:51:03 +00:00

  • Target Version set to 1.0 RC1

adding postgres support to idoutils prepares the queries and the data the way we will use them for oracle. since ocilib will be used instead of libdbi, db connection also need to be rewritten. enabling oracle will be done by a special flag in configure and then requiring ocilib instead of libdbi.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-10-08 11:27:31 +00:00

  • Priority changed from Normal to High
  • Done % changed from 0 to 40

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-10-16 19:20:13 +00:00

  • Done % changed from 40 to 80

ocilib connection - ok
ocilib queries - ok
ocilib error handler - ok
merge statements - ok

last sequence ids - pending
long_output - pending
table fixing - pending

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2009-10-19 16:54:42 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 80 to 100

done. initial support will be in 1.0 RC

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant