[root@lussvpnagiosxi00 tmp]# ./oracleinstall.sh
#######################################
# #
# This is the installer script #
# for installing Oracle monitoring #
# libraries. #
# #
# Before you continue, be sure that #
# the oracle-basic, sqlplus and devel #
# are in the same directory as this #
# installer script. #
# #
#######################################
Loaded plugins: changelog, product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
epel/metalink | 13 kB 00:00
nagios-base | 1.5 kB 00:00
nagiosxi-deps | 1.5 kB 00:00
rhel-x86_64-server-6 | 1.5 kB 00:00
rhel-x86_64-server-optional-6 | 1.5 kB 00:00
rhn-tools-rhel-x86_64-server-6 | 1.3 kB 00:00
rpmforge | 1.9 kB 00:00
Package perl-YAML-0.70-4.el6.noarch already installed and latest version
Nothing to do
Loaded plugins: changelog, product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Local Package Process
Cannot open: oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm. Skipping.
Cannot open: oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm. Skipping.
Cannot open: oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm. Skipping.
Nothing to do
RPM installation was successful!
CPAN may ask you questions. Choose 'No' if it asks if you want to
do a manual install, unless you have special internet settings.
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters...
The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide or a personal directory.
First of all, I'd like to create this directory. Where?
<cpan_home>
CPAN build and cache directory? [/root/.cpan]
cat oracleinstall.sh
#!/bin/sh
set -e
set -u
PLUGIN_URL="http://assets.nagios.com/downloads/nagiosxi/packages/check_oracle_health-1.7.3.tar.gz"
PLUGIN_VER=$(echo "$PLUGIN_URL" | sed 's/.*check_oracle_health-\(.*\).tar.gz/\1/')
cat <<- EOF
#######################################
# #
# This is the installer script #
# for installing Oracle monitoring #
# libraries. #
# #
# Before you continue, be sure that #
# the oracle-basic, sqlplus and devel #
# are in the same directory as this #
# installer script. #
# #
#######################################
EOF
### DO YUM
yum -y install perl-YAML
# DO RPM INSTALLS
yum -y --nogpgcheck localinstall \
oracle-instantclient*basic*.rpm \
oracle-instantclient*sqlplus*.rpm \
oracle-instantclient*devel*.rpm
echo "RPM installation was successful!"
### SETTING ENVIRONMENT VARIABLES
if arch | grep 64 >/dev/null; then
client="client64"
else
client="client"
fi
version=$(echo oracle-instantclient*basic*.rpm | sed 's/.*instantclient\([0-9.]*\).*/\1/')
export ORACLE_HOME="/usr/lib/oracle/$version/$client"
export LD_LIBRARY_PATH="$ORACLE_HOME/lib"
### BEGIN CPAN INSTALL
echo "CPAN may ask you questions. Choose 'No' if it asks if you want to"
echo "do a manual install, unless you have special internet settings."
cpan -i DBI
cpan -i DBD::Oracle
# BEGIN SOURCE INSTALL :(
echo "Beginning source install..."
wget "$PLUGIN_URL"
tar xvf check_oracle_health-$PLUGIN_VER.tar.gz
(
cd check_oracle_health-$PLUGIN_VER
./configure
make && make install
)
# DO MKDIR
mkdir /var/tmp/check_oracle_health
chown -R nagios /var/tmp/check_oracle_health
echo "ORACLE_HOME=/usr/lib/oracle/$version/$client"
echo "LD_LIBRARY_PATH=/usr/lib/oracle/$version/$client/lib"
All the files are in /tmp location.
From which should I need to install and to which location the files goes to??
You'll be prompted with a bunch of questions, just press enter to accept all the defaults. You may need to define a mirror at some point.
Finally you'll get to a cpan> prompt.
Type quit
Now try the ./oracleinstall.sh script.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
You'll be prompted with a bunch of questions, just press enter to accept all the defaults. You may need to define a mirror at some point.
Finally you'll get to a cpan> prompt.
Type quit
cpan
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters...
The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide or a personal directory.
I see you already have a directory
/root/.cpan
Shall we use it as the general CPAN build and cache directory?
<cpan_home>
CPAN build and cache directory? [/root/.cpan]
Unless you are accessing the CPAN on your filesystem via a file: URL,
CPAN.pm needs to keep the source files it downloads somewhere. Please
supply a directory where the downloaded files are to be kept.
<keep_source_where>
Download target directory? [/root/.cpan/sources]
<build_dir>
Directory where the build process takes place? [/root/.cpan/build]
Normally CPAN.pm keeps config variables in memory and changes need to
be saved in a separate 'o conf commit' command to make them permanent
between sessions. If you set the 'auto_commit' option to true, changes
to a config variable are always automatically committed to disk.
<auto_commit>
Always commit changes to config variables to disk? [no]
CPAN.pm can limit the size of the disk area for keeping the build
directories with all the intermediate files.
<build_cache>
Cache size for build directory (in MB)? [100]
The CPAN indexes are usually rebuilt once or twice per hour, but the
typical CPAN mirror mirrors only once or twice per day. Depending on
the quality of your mirror and your desire to be on the bleeding edge,
you may want to set the following value to more or less than one day
(which is the default). It determines after how many days CPAN.pm
downloads new indexes.
<index_expire>
Let the index expire after how many days? [1]
By default, each time the CPAN module is started, cache scanning is
performed to keep the cache size in sync. To prevent this, answer
'never'.
<scan_cache>
Perform cache scanning (atstart or never)? [atstart]
To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable is
not available, the normal index mechanism will be used.
Note: this mechanism is not used when use_sqlite is on and SQLLite is
running.
<cache_metadata>
Cache metadata (yes/no)? [yes]
The CPAN module can detect when a module which you are trying to build
depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.
<prerequisites_policy>
Policy on building prerequisites (follow, ask or ignore)? [ask]
Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in separate processes. If you have
any parameters (e.g. PREFIX, UNINST or the like) you want to
pass to the calls, please specify them here.
If you don't understand this question, just press ENTER.
Typical frequently used settings:
PREFIX=~/perl # non-root users (please see manual for more hints)
<makepl_arg>
Parameters for the 'perl Makefile.PL' command? [INSTALLDIRS=site]
Parameters for the 'make' command? Typical frequently used setting:
-j3 # dual processor system (on GNU make)
<make_arg>
Your choice: []
Parameters for the 'make install' command?
Typical frequently used setting:
UNINST=1 # to always uninstall potentially conflicting files
<make_install_arg>
Your choice: []
A Build.PL is run by perl in a separate process. Likewise we run
'./Build' and './Build install' in separate processes. If you have any
parameters you want to pass to the calls, please specify them here.
Typical frequently used settings:
--install_base /home/xxx # different installation directory
<mbuildpl_arg>
Parameters for the 'perl Build.PL' command? [--installdirs site]
Parameters for the './Build' command? Setting might be:
--extra_linker_flags -L/usr/foo/lib # non-standard library location
<mbuild_arg>
Your choice: []
Do you want to use a different command for './Build install'? Sudo
users will probably prefer:
su root -c ./Build
or
sudo ./Build
or
/path1/to/sudo -u admin_account ./Build
<mbuild_install_build_command>
or some such. Your choice: [./Build]
Parameters for the './Build install' command? Typical frequently used
setting:
--uninst 1 # uninstall conflicting files
<mbuild_install_arg>
Your choice: []
If you're accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.
<ftp_proxy>
Your ftp_proxy? []
<http_proxy>
Your http_proxy? []
<no_proxy>
Your no_proxy? []
CPAN needs access to at least one CPAN mirror.
As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now.
Please enter the URL of your CPAN mirror
CPAN needs access to at least one CPAN mirror.
As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now.
Please enter the URL of your CPAN mirror
CPAN needs access to at least one CPAN mirror.
As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now.
What mirror I should give, I am not sure on this, please help.. thanks.
chmod +x check_oracle_health
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
Making all in t
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3'
Making install in plugins-scripts
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
make[2]: Entering directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
test -z "/usr/local/nagios/libexec" || mkdir -p -- "/usr/local/nagios/libexec"
/usr/bin/install -c 'check_oracle_health' '/usr/local/nagios/libexec/check_oracle_health'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/plugins-scripts'
Making install in t
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3/t'
make[2]: Entering directory `/tmp/check_oracle_health-1.7.3/t'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3/t'
make[1]: Entering directory `/tmp/check_oracle_health-1.7.3'
make[2]: Entering directory `/tmp/check_oracle_health-1.7.3'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/check_oracle_health-1.7.3'
make[1]: Leaving directory `/tmp/check_oracle_health-1.7.3'
ORACLE_HOME=/usr/lib/oracle/12.1/client64
LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
[root@lussvpnagiosxi00 ~]# ll /usr/lib/oracle/12.1/client64
ls: cannot access /usr/lib/oracle/12.1/client64: No such file or directory
[root@lussvpnagiosxi00 ~]# ll /usr/lib/oracle/12.1/client64/lib
ls: cannot access /usr/lib/oracle/12.1/client64/lib: No such file or directory
[root@lussvpnagiosxi00 ~]# /usr/local/nagios/libexec/check_oracle_health --version
check_oracle_health (1.7.3)
This nagios plugin comes with ABSOLUTELY NO WARRANTY. You may redistribute
copies of this plugin under the terms of the GNU General Public License.
[root@lussvpnagiosxi00 ~]# perldoc DBD::Oracle
No documentation found for "DBD::Oracle".
If this folder doesn't have a file called demo.mk, then the Oracle 12.1 client isn't compatible with the DBD::Oracle perl module and you may need to remove the 12.1 clients and install the Oracle client version 11.2.
Be sure to check out our Knowledgebase for helpful articles and solutions!
If this folder doesn't have a file called demo.mk, then the Oracle 12.1 client isn't compatible with the DBD::Oracle perl module and you may need to remove the 12.1 clients and install the Oracle client version 11.2.
ls -l /usr/share/oracle/12.1/client64/
ls: cannot access /usr/share/oracle/12.1/client64/: No such file or directory
Could you please let me know how can I remove Oracle 12.1, And I am trying the same on another server too even that is having the same issue. Please advise..