check_oracle_health

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.
Locked
mcarpe
Posts: 2
Joined: Fri Jul 06, 2018 6:30 pm

check_oracle_health

Post by mcarpe »

Hi I am building a new centos 7 server. I have installed Nagios core 4.4.1 and ran through the varios DBD::Oracle DBI installs via cpan etc.
I am abe to get check_oracle_health to work at a command line via the nagios user; however, when ran through Nagios it errors.

Code: Select all

check_oracle_health -t 30 --connect ORADB1 --user myuser --password mypass --mode connection-time --warning 15 --critical 25
OK - 0.38 seconds to connect as myuser | connection_time=0.3807;15;25
Via nagios core though, It errors with

Code: Select all

CRITICAL - cannot connect to ORADB1. install_driver(Oracle) failed: Can't locate loadable object for module DBD::Oracle in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 13) line 3.
This seems like it's a common topic when searching around the net and the forum here but I am not making any headway on what the issue is. It feels like it's just a en enviroment path issue when envoked via noninteractive shell or something. Has anyone elese experienced a similar issue with this and willing to help point me in the right direction?

instantclient base, sqlplus, sdk was installed.
I have this set in my /etc/profile.d/sh.loal,

cat /etc/profile.d/sh.local

Code: Select all

#Add any required envvar overrides to this file, it is sourced from /etc/profile
export LD_LIBRARY_PATH=/opt/oracle/instantclient_18_3
export ORACLE_HOME=/opt/oracle/instantclient_18_3
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=/opt/oracle/instantclient_18_3:$PATH
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_oracle_health

Post by scottwilkerson »

you need to change your commands in core to include the paths like this

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/opt/oracle/instantclient_18_3 ORACLE_HOME=/opt/oracle/instantclient_18_3 $USER1$/check_oracle_health $ARG1$
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
mcarpe
Posts: 2
Joined: Fri Jul 06, 2018 6:30 pm

Re: check_oracle_health

Post by mcarpe »

thank you for the feedback. envoking the command in this way solved my issue. Appreciate your time.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_oracle_health

Post by scottwilkerson »

mcarpe wrote:thank you for the feedback. envoking the command in this way solved my issue. Appreciate your time.
Great!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked