DBD:Oracle
Posted: Tue Sep 05, 2017 1:41 pm
Hi, my server is CentOS Linux release 7.3.1611 (Core) and i have NagiosĀ® Coreā¢ 4.2.0. I have install the plugin check_oracle_health with no problem.
I am execute the command with the both users (root and nagios), and works:
[root@srvmonitor libexec]# /usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping
OK - connection established to ORCLDSV.
[nagios@srvmonitor ~]$ /usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping
OK - connection established to ORCLDSV.
But, monitor web show me:
CRITICAL - cannot connect to ORCLDSV. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm 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 14) line 3.
Maybe, the user nagios, not load variables to connect Oracle. The commands for execute as nagios from root:
[root@srvmonitor libexec]# sudo -S -u nagios -i /bin/bash -c '/usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping'
OK - connection established to ORCLDSV.
[root@srvmonitor libexec]# sudo -S -u nagios /bin/bash -c '/usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping'
CRITICAL - cannot connect to ORCLDSV. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm 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 14) line 3.
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge, mysql.
at /usr/local/nagios/libexec/check_oracle_health line 6155.
See the parameter -i, send me variables, but without, no. I export the variables into all locations, bash_profile, bashrc, profile, etc. Not work. Anybody tell me what are wrong?
I am execute the command with the both users (root and nagios), and works:
[root@srvmonitor libexec]# /usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping
OK - connection established to ORCLDSV.
[nagios@srvmonitor ~]$ /usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping
OK - connection established to ORCLDSV.
But, monitor web show me:
CRITICAL - cannot connect to ORCLDSV. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm 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 14) line 3.
Maybe, the user nagios, not load variables to connect Oracle. The commands for execute as nagios from root:
[root@srvmonitor libexec]# sudo -S -u nagios -i /bin/bash -c '/usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping'
OK - connection established to ORCLDSV.
[root@srvmonitor libexec]# sudo -S -u nagios /bin/bash -c '/usr/local/nagios/libexec/check_oracle_health --connect=ORCLDSV --username=nagios --password=oradbmon --mode=tnsping'
CRITICAL - cannot connect to ORCLDSV. install_driver(Oracle) failed: Can't locate DBD/Oracle.pm 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 14) line 3.
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge, mysql.
at /usr/local/nagios/libexec/check_oracle_health line 6155.
See the parameter -i, send me variables, but without, no. I export the variables into all locations, bash_profile, bashrc, profile, etc. Not work. Anybody tell me what are wrong?