Page 1 of 2

install_driver(Oracle)

Posted: Tue Jan 14, 2014 9:42 am
by JanePisk
hi all!!

a check_oracle_health plugin return me this error

I've followed this guide http://en.alexnogard.com/monitoring-ora ... -centreon/

CRITICAL - cannot connect to nagios/***@xwikio. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200.

any ideas??

Re: install_driver(Oracle)

Posted: Tue Jan 14, 2014 12:00 pm
by abrist
Did you install the oracle sdk?
What is the full check command you are using? (you need to make sure to specify the LD_LIBRARY_PATH and ORACLE_HOME environment variables in the check)

Re: install_driver(Oracle)

Posted: Wed Jan 15, 2014 6:09 am
by JanePisk
the full check command is
/usr/local/nagios/libexec/check_oracle_health --mode=connection-time --connect=nagios/oradbmon@xwikidb

my ORACLE_HOME is/u01/app/oracle/product/11.2.0/dbhome_1

and LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

what is oracle sdk?

Re: install_driver(Oracle)

Posted: Wed Jan 15, 2014 11:11 am
by slansing
You need to run through this document, it was designed for nagios XI but you can replicate it with Core:

http://assets.nagios.com/downloads/nagi ... lation.pdf

Re: install_driver(Oracle)

Posted: Fri Jan 17, 2014 6:31 am
by JanePisk
ok,
first thanks for reply.. ;)
now the plugin ( if I run it by console with nagios user ) works ,
but by the nagios interface i've this error

CRITICAL - cannot connect to nagios/***@xwikio. ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)

obvious! because ORACLE_HOME is set = oracle client path .
why nagios interface don't work with nagios user (that have the ORACLE_HOME = db path) ?

ps : sorry for my not so good english!!! :roll:

Re: install_driver(Oracle)

Posted: Fri Jan 17, 2014 7:24 am
by JanePisk
excuse,
does not work anymore!
the error is the same as before, I just reboot the system and it does not work anymore. :evil:

CRITICAL - cannot connect to nagios/***@xwikio. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200.

I have to reset the oracle_home path on the client before and after the path of the db.
but it is not possible!!!!!

any ideas??!?!?!?

confused... :?:

Re: install_driver(Oracle)

Posted: Fri Jan 17, 2014 12:43 pm
by slansing
You should not be setting those paths to your remote oracle server's db path, you need to direct them as we have set in the documentation based on what version of the oracle client you installed on the nagios server. In addition, you will need to find a valid and running TNS listener service name and pass that through your service/command configuration on the nagios server. You can use this guide to install the prerequisites, it was created for nagios xi but you can do the same things on a Core installation, skipping Wizard usage:

http://assets.nagios.com/downloads/nagi ... lation.pdf

Re: install_driver(Oracle)

Posted: Tue Jan 21, 2014 11:26 am
by JanePisk
:evil:

Code: Select all

[root@Ofelia objects]# export ORACLE_HOME=/usr/lib/oracle/11.2/client64/
[root@Ofelia objects]# cpan -i DBD::Oracle
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
  Database was generated on Fri, 17 Jan 2014 10:29:02 GMT
CPAN: Time::HiRes loaded ok (v1.9721)
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp6789'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
  LWP not available

Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
    "http://www.perl.org/CPAN/authors/01mailrc.txt.gz"

^C
    Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://www.perl.org/CPAN/authors/01mailrc.txt.gz"  > /root/.cpan/sources/authors/01mailrc.txt.tmp6789")
    returned status 0 (wstat 2)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp6789] doesn't exist
    
Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc.txt.tmp6789" to get
    "http://www.perl.org/CPAN/authors/01mailrc.txt.gz"
--2014-01-21 17:22:42--  http://www.perl.org/CPAN/authors/01mailrc.txt.gz
Risoluzione di www.perl.org... 207.171.7.41, 207.171.7.51
Connessione a www.perl.org|207.171.7.41|:80... ^C
    Function system("/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc.txt.tmp6789 "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" ")
    returned status 0 (wstat 2)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp6789] doesn't exist
    Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp6789'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
^C
[root@Ofelia objects]# export http_proxy='192.168.0.1:8080'
[root@Ofelia objects]# cpan -i DBD::Oracle
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
  Database was generated on Fri, 17 Jan 2014 10:29:02 GMT
CPAN: Time::HiRes loaded ok (v1.9721)
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp6862'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
  LWP not available

Proxy authentication needed!
 (Note: to permanently configure username and password run
   o conf proxy_user your_username
   o conf proxy_pass your_password
     )
Username:  root
Warning: Term::ReadKey seems not to be available, your password will be echoed to the terminal!
Password:  XXXXX



Trying with "/usr/bin/curl -L -f -s -S --netrc-optional -U "root:XXXXX" -x "192.168.0.1:8080"" to get
    "http://www.perl.org/CPAN/authors/01mailrc.txt.gz"
CPAN: YAML loaded ok (v0.70)
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Warning: no success downloading '/root/.cpan/sources/modules/02packages.details.txt.gz.tmp6862'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225

Proxy authentication needed!
 (Note: to permanently configure username and password run
   o conf proxy_user your_username
   o conf proxy_pass your_password
     )
Username:  
Warning: Term::ReadKey seems not to be available, your password will be echoed to the terminal!
Password:  



Trying with "/usr/bin/curl -L -f -s -S --netrc-optional -U ":" -x "192.168.0.1:8080"" to get
    "http://www.perl.org/CPAN/modules/02packages.details.txt.gz"
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Tue, 21 Jan 2014 16:17:02 GMT
  HTTP::Date not available
..............
  New CPAN.pm version (v2.00) available.
  [Currently running version is v1.9402]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


..............................................................DONE
Warning: no success downloading '/root/.cpan/sources/modules/03modlist.data.gz.tmp6862'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225

Proxy authentication needed!
 (Note: to permanently configure username and password run
   o conf proxy_user your_username
   o conf proxy_pass your_password
     )
Username:  
Warning: Term::ReadKey seems not to be available, your password will be echoed to the terminal!
Password:  



Trying with "/usr/bin/curl -L -f -s -S --netrc-optional -U ":" -x "192.168.0.1:8080"" to get
    "http://www.perl.org/CPAN/modules/03modlist.data.gz"
Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
............................................................................DONE
Going to write /root/.cpan/Metadata
DBD::Oracle is up to date (1.68).
[root@Ofelia objects]# env
don't work

the error is the same....

EDIT: I removed mentions of your password -- tmcdonald

Re: install_driver(Oracle)

Posted: Tue Jan 21, 2014 5:51 pm
by slansing
Be sure you export your library path as well, and be sure they are the correct path to your client installation, it will differ based on what architecture you are using. Then run:

Code: Select all

perl -e shell -MCPAN
Once in CPAN run:

Code: Select all

install DBD::Oracle
You will likely need to pull a few dependencies down along the way.

Re: install_driver(Oracle)

Posted: Wed Jan 22, 2014 4:32 am
by JanePisk
[root@Ofelia ~]# export ORACLE_HOME=/usr/lib/oracle/11.2/client64/
[root@Ofelia ~]# export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib/
[root@Ofelia ~]# perl -e shell -MCPAN
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]> install DBD::Oracle
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Tue, 21 Jan 2014 16:17:02 GMT
DBD::Oracle is up to date (1.68).

cpan[2]>

stop!!!!
i don't understand why nagios service uses root user and not nagios user... :?: :?: :?: