install_driver(Oracle)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
JanePisk
Posts: 21
Joined: Wed Nov 06, 2013 9:46 am

install_driver(Oracle)

Post 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??
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: install_driver(Oracle)

Post 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)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
JanePisk
Posts: 21
Joined: Wed Nov 06, 2013 9:46 am

Re: install_driver(Oracle)

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: install_driver(Oracle)

Post 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
JanePisk
Posts: 21
Joined: Wed Nov 06, 2013 9:46 am

Re: install_driver(Oracle)

Post 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:
JanePisk
Posts: 21
Joined: Wed Nov 06, 2013 9:46 am

Re: install_driver(Oracle)

Post 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... :?:
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: install_driver(Oracle)

Post 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
JanePisk
Posts: 21
Joined: Wed Nov 06, 2013 9:46 am

Re: install_driver(Oracle)

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: install_driver(Oracle)

Post 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.
JanePisk
Posts: 21
Joined: Wed Nov 06, 2013 9:46 am

Re: install_driver(Oracle)

Post 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... :?: :?: :?:
Locked