[root@wallet03 ~]# yum install -y perl-App-cpanminus.noarch
[root@wallet03 ~]# cpanm Test::Simple
--> Working on Test::More
Fetching http://www.cpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302183.tar.gz ... OK
Configuring Test-Simple-1.302183 ... OK
Building and testing Test-Simple-1.302183 ... OK
Successfully installed Test-Simple-1.302183
1 distribution installed
[root@wallet03 ~]# cpanm ExtUtils::MakeMaker
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.56.tar.gz ... OK
Configuring ExtUtils-MakeMaker-7.56 ... OK
Building and testing ExtUtils-MakeMaker-7.56 ... OK
Successfully installed ExtUtils-MakeMaker-7.56 (upgraded from 6.68)
1 distribution installed
[root@wallet03 ~]# cpanm Time::HiRes
--> Working on Time::HiRes
Fetching http://www.cpan.org/authors/id/A/AT/ATOOMIC/Time-HiRes-1.9764.tar.gz ... OK
Configuring Time-HiRes-1.9764 ... OK
Building and testing Time-HiRes-1.9764 ... OK
Successfully installed Time-HiRes-1.9764 (upgraded from 1.9725)
1 distribution installed
[root@wallet03 ~]# cpanm DBI
--> Working on DBI
Fetching http://www.cpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz ... OK
Configuring DBI-1.643 ... OK
Building and testing DBI-1.643 ... OK
Successfully installed DBI
[root@wallet03 ~]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
[root@wallet03 ~]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
[root@wallet03 ~]# rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
[root@wallet03 ~]# vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/lib/oracle/11.2/client64/lib
[root@wallet03 ~]# ldconfig
[root@wallet03 ~]# cpanm DBD::Oracle
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/M/MJ/MJEVANS/DBD-Oracle-1.80.tar.gz ... OK
==> Found dependencies: Test::NoWarnings
--> Working on Test::NoWarnings
Fetching http://www.cpan.org/authors/id/A/AD/ADAMK/Test-NoWarnings-1.04.tar.gz ... OK
Configuring Test-NoWarnings-1.04 ... OK
Building and testing Test-NoWarnings-1.04 ... OK
Successfully installed Test-NoWarnings-1.04
Configuring DBD-Oracle-1.80 ... OK
Building and testing DBD-Oracle-1.80 ... OK
Successfully installed DBD-Oracle-1.80
2 distributions installed
[root@wallet03 ~]# mkdir -p /usr/lib/oracle/11.2/client64/lib/network/admin
[root@wallet03 ~]# cd /usr/lib/oracle/11.2/client64/lib/network/admin
[root@wallet03 admin]# vim tnsnames.ora
walletmdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.40)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = wallet)
)
)
walletsdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.41)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = wallet)
)
)
[root@wallet03 ~]# /usr/lib/oracle/11.2/client64/bin/sqlplus system/oracle@walletmdb
SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 2 10:53:47 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
[root@wallet03 ~]# tar zxvf check_oracle_health-3.2.1.3.tar.gz
[root@wallet03 ~]# cd check_oracle_health-3.2.1.3
[root@wallet03 check_oracle_health-3.2.1.3]# ./configure
[root@wallet03 check_oracle_health-3.2.1.3]# make
[root@wallet03 check_oracle_health-3.2.1.3]# make install
[root@wallet03 ~]# cd /usr/local/nagios/libexec
[root@wallet03 libexec]# ./check_oracle_health --help
Copyright (c) 2008 Gerhard Lausser
Check various parameters of Oracle databases
Usage:
check_oracle_health [-v] [-t ] --connect=
--username= --password= --mode=
--tablespace=
check_oracle_health [-h | --help]
check_oracle_health [-V | --version]
Options:
--connect
the connect string
--username
the oracle user
--password
the oracle user's password
--warning
the warning range
--critical
the critical range
--mode
the mode of the plugin. select one of the following keywords:
tnsping (Check the reachability of the server)
connection-time (Time to connect to the server)
password-expiration (Check the password expiry date for users)
connected-users (Number of currently connected users)
session-usage (Percentage of sessions used)
process-usage (Percentage of processes used)
blocking-sessions (Find blocking sessions)
rman-backup-problems (Number of rman backup errors during the last 3 days)
sga-data-buffer-hit-ratio (Data Buffer Cache Hit Ratio)
sga-library-cache-gethit-ratio (Library Cache (Get) Hit Ratio)
sga-library-cache-pinhit-ratio (Library Cache (Pin) Hit Ratio)
sga-library-cache-reloads (Library Cache Reload (and Invalidation) Rate)
sga-dictionary-cache-hit-ratio (Dictionary Cache Hit Ratio)
sga-latches-hit-ratio (Latches Hit Ratio)
sga-shared-pool-reload-ratio (Shared Pool Reloads vs. Pins)
sga-shared-pool-free (Shared Pool Free Memory)
pga-in-memory-sort-ratio (PGA in-memory sort ratio)
invalid-objects (Number of invalid objects in database)
stale-statistics (Find objects with stale optimizer statistics)
corrupted-blocks (Number of corrupted blocks in database)
tablespace-usage (Used space in tablespaces)
tablespace-free (Free space in tablespaces)
container-tablespace-free (Free space in tablespaces of container databases)
tablespace-remaining-time (Remaining time until a tablespace is full)
tablespace-fragmentation (Free space fragmentation index)
tablespace-io-balance (balanced io of all datafiles)
tablespace-can-allocate-next (Segments (of a tablespace) can allocate next extent)
datafile-io-traffic (io operations/per sec of a datafile)
datafiles-existing (Percentage of the maximum possible number of datafiles)
datafiles-recovery (Check if datafiles need media recovery)
datafiles-offline (Check if datafiles are offline)
asm-diskgroup-usage (Used space in diskgroups)
asm-diskgroup-free (Free space in diskgroups)
soft-parse-ratio (Percentage of soft parses)
switch-interval (Time between redo log file switches)
retry-ratio (Redo buffer allocation retries)
redo-io-traffic (Redo log io bytes per second)
roll-header-contention (Rollback segment header contention)
roll-block-contention (Rollback segment block contention)
roll-hit-ratio (Rollback segment hit ratio (gets/waits))
roll-wraps (Rollback segment wraps (per sec))
roll-extends (Rollback segment extends (per sec))
roll-avgactivesize (Rollback segment average active size)
seg-top10-logical-reads (user objects among top 10 logical reads)
seg-top10-physical-reads (user objects among top 10 physical reads)
seg-top10-buffer-busy-waits (user objects among top 10 buffer busy waits)
seg-top10-row-lock-waits (user objects among top 10 row lock waits)
event-waits (processes wait events)
event-waiting (time spent by processes waiting for an event)
enqueue-contention (percentage of enqueue requests which must wait)
enqueue-waiting (percentage of time spent waiting for the enqueue)
latch-contention (percentage of latch get requests which must wait)
latch-waiting (percentage of time a latch spends sleeping)
sysstat (change of sysstat values over time)
dataguard-lag (Dataguard standby lag)
dataguard-mrp-status (Dataguard standby MRP status)
flash-recovery-area-usage (Used space in flash recovery area)
flash-recovery-area-free (Free space in flash recovery area)
failed-jobs (The jobs which did not exit successful in the last minutes (use --lookback))
num-scheduled-jobs (The number of scheduled jobs (high number may trigger a bug in oracle))
sql (any sql command returning a single number)
sql-runtime (the time an sql command needs to run)
list-tablespaces (convenience function which lists all tablespaces)
container-list-tablespaces (convenience function which lists all tablespaces of all container databases)
list-datafiles (convenience function which lists all datafiles)
list-asm-diskgroups (convenience function which lists all asm diskgroups)
list-enqueues (convenience function which lists all enqueues)
list-latches (convenience function which lists all latches)
list-events (convenience function which lists all events)
list-background-events (convenience function which lists all background events)
list-sysstats (convenience function which lists all statistics from v$sysstat)
[root@wallet03 libexec]# ./check_oracle_health --connect=walletmdb --username=system --password=oracle --mode=tnsping
OK - connection established to walletmdb.
[root@wallet03 libexec]# ./check_oracle_health --connect=walletmdb --username=system --password=oracle --mode=connection-time
OK - 0.09 seconds to connect as SYSTEM | connection_time=0.0929;1;5