Thanks again Eric.
I’m now in installing OCI8. But get the error:
Building native extensions. This could take a while…
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
current directory: /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/ruby-oci8-2.2.3/ext/oci8
/opt/sensu/embedded/bin/ruby -r ./siteconf20170531-19867-1jij4uz.rb extconf.rb
checking for load library path…
LD_LIBRARY_PATH is not set.
checking ld.so.conf… no
checking for cc… ok
checking for gcc… yes
checking for LP64… yes
checking for sys/types.h… yes
checking for ruby header… ok
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:963:in `get_home’: RuntimeError (RuntimeError)
from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:779:in `initialize’
from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:320:in `new’
from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/ruby-oci8-2.2.3/ext/oci8/oraconf.rb:320:in `get’
from extconf.rb:22:in `’
Set the environment variable ORACLE_HOME if Oracle Full Client.
Append the path of Oracle client libraries to LD_LIBRARY_PATH if Oracle Instant Client.
The ‘sudo’ command unset some environment variables for security reasons.
Pass required varialbes as follows
sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH /opt/sensu/embedded/bin/gem install ruby-oci8
sudo env ORACLE_HOME=$ORACLE_HOME /opt/sensu/embedded/bin/gem install ruby-oci8
To see why this extension failed to compile, please check the mkmf.log which can be found here:
extconf failed, exit code 1
Gem files will remain installed in /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/ruby-oci8-2.2.3 for inspection.
Results logged to /opt/sensu/embedded/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/ruby-oci8-2.2.3/gem_make.out
The following are the steps I’ve made to configure this
Download Instant Client (Basic, JDK and SQL Plus) in
Transfer all zip files to /opt/oracle using FileZilla
Login to Unix Server and go to /opt/oracle directory
Execute the following
sudo su -l root
yum install libaio (prompted that it is already installed)
sudo env LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2
sudo /opt/sensu/embedded/bin/gem install ruby-oci8
I very much appreciate your assistance
On Wednesday, May 31, 2017 at 3:08:43 PM UTC+8, Eric Heydrick wrote:
When you run gem without the full path you get the system ruby. In this case it’s Ruby 1.8 which is end of life and you really don’t want to use it for performance and security reasons. Instead use the ruby that sensu ships as part of the omnibus package. To do that use the full path to the embedded gem command, /opt/sensu/embedded/bin/gem.
On Tue, May 30, 2017 at 11:36 PM, Peter Russy Alfafara peter.russ...@gmail.com wrote:
Thanks for the assistance!
I’ve followed the instructions in the link and I’m currently stuck at an error while I’m installing ruby:
#/home/oracle> sudo gem update
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:11:in `require’: no such file to load – thread (LoadError)
from /usr/bin/gem:8:in `require’
Any ideas what’s causing this? Thank you for your prompt response btw
On Wednesday, May 31, 2017 at 12:16:37 PM UTC+8, Eric Heydrick wrote:
You should install the ruby-oci8 gem into the sensu embedded ruby. To do that run “/opt/sensu/embedded/bin/gem install ruby-oci8”. According to the docs you need the oracle client installed and to set an environment variable that points at the client installation.
On Tue, May 30, 2017 at 8:49 PM, Peter Russy Alfafara peter.russ...@gmail.com wrote:
It doesn’t seem to be installed in this directory.
#/opt/sensu/embedded/bin> /opt/sensu/embedded/bin/gem list | grep oci8
[oracle@otmdemox] -->orcl<-- 12R12
But I already installed it in the server using the following steps:
- download latest version from https://bintray.com/kubo/generic/ruby-oci8
- Move downloaded tar file to server using FileZilla
- Login to Server and go to directory where the tar is
- execute ‘gzip -dc ruby-oci8-2.2.3.tar.gz | tar xvf –‘
- execute ‘sudo su -l root’
- cd /home/oracle/ruby-oci8-2.2.3
- make install
Are my installation steps incorrect?
Thank you again!
On Saturday, May 27, 2017 at 1:06:05 AM UTC+8, Eric Heydrick wrote:
Do you have the oci8 gem installed in the sensu embedded ruby? Run /opt/sensu/embedded/bin/gem list | grep oci8 to make sure it’s there.
On Thu, May 25, 2017 at 11:15 PM, Peter Russy Alfafara peter.russ...@gmail.com wrote:
I would like to get your assistance on an issue I am experiencing.
I am customizing my own check that queries to an Oracle Database using Ruby DBI OCI8. I’ve installed this plugin in our centos server and tried to execute the following by calling it and it executes fine with the desired results.
#! /usr/bin/env ruby
oci = OCI8.new(‘GLOGOWNER’,‘Sh#reit1’,‘192.168.30.223:1521/orcl’)
oci.exec(‘select shipment_gid, shipment_xid, servprov_gid from shipment where rownum <= 1’) do |record|
But, somehow when I’m calling this script in sensu using check config file, I get an error result
“handlers”: [“event_stream”, “email”],
“subscribers”: [ “ALL” ]
require': cannot load such file -- oci8 (LoadError) from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire’ from /opt/sensu/embedded/bin/dbconnect.rb:3:in `’
Hoping you can assist me on this matter. Thank you!