Home Directory Plugins Databases Oracle Check Oracle status & health without install Oracle client - enhanced

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Check Oracle status & health without install Oracle client - enhanced

Rating
1 vote
Favoured:
0
Current Version
v1.1
Last Release Date
2012-12-18
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
License
GPL
Hits
51338
Files:
FileDescription
check_oracle_instantcheck_oracle_instant
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This perl nagios plugin is a really enhanced version of the popular check_oracle_instant script.

Latest updates see https://github.com/gdoornenbal/monitoring-plugins
Major enhancements:
* Added Tablespace usage check. Find's the tablespace with the highest percentage used.
(counting max tablespace filesize against the real filesize minus the free space inside the db file.)
* Better help and command line options.
* Risk of locked users due to wrong parameters is much lower.
* Better error handling.
* Database health error give more info.
* Store default settings in config file.
* Options added to skip specific tests, when specific results are not marked as problematic.

It allows you to check oracle service (ability to connect to database ) and the health of oracle database (TableSpace Usage, Dictionary Cache Hit Ratio, Library Cache Hit Ratio, DB Block Buffer Cache Hit Ratio, Latch Hit Ratio, Disk Sort Ratio, Rollback Segment Waits, Dispatcher Workload) It is possible to define your own parameters.

Big advantage is that it does not need to install the complete ORACLE client or compile other perl modules.

Installation:

1. Download the Oracle instant client. (http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html, pick your OS.) Download the two following packages:
* Instant Client Package - Basic
* Instant Client Package - SQL*Plus
Install these packages, and make sqlplus runnable from anywhere. (i had to add following lines in .bashrc in my nagios account (using client64 on SLES11 system):

ORACLE_HOME=/usr/lib/oracle/10.2.0.5/client64
PATH=$ORACLE_HOME/bin:$PATH
PATH=$ORACLE_HOME/lib:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME
export LD_LIBRARY_PATH
export PATH

Test sqlplus with following command: sqlplus user/passwd@"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=IP or hostname)(Port=port))(CONNECT_DATA=(SID=sid)))"
Remember to fully restart your nagios instance to get these settings into your nagios environment.

2. Copy check_oracle_instant script to libexec directory (on linux /usr/local/nagios/libexec)
and set correct rights and owner.

3. Add correct commands etc to nagios. (you can test from commandline which options to use)

Help info:
This plugin logs into the database and does some health checking inside the database.

Usage: check_oracle_instant -H host -l listener-port -s SID -u username -p password -n tdlbasrw -f filename

Options:
-H --host STRING or IPADDRESS
Address of the indicated host.
-p --lsn portnumber
Oracle listener port number.
-s --sid Connect String
Oracle connect string
-u --user username
Oracle login name
-w --pass password
Oracle password
-n --nocheck dlbasrw
Here you can disable specific tests in case you don't want them:
t: Tablespace usage
d: Dictionary Cache Hit Ratio
l: Library Cache Hit Ratio
b: DB Block Buffer Cache Hit Ratio
a: Latch Hit Ratio
s: Disk Sort Ratio
r: Rollback Segment Waits
w: Dispatcher Workload
-f --file filename
Filename with any (default) option as stated above.
This file contains one line, with all options you wish to use. example:
-l 1521 -u system -p testpass
Settings set after the -f in the commandline wil override the settings in this file.

The author is using this script on a Suse SLES11 OPSview (nagios v3) server against an oracle 10.2 database server.
Reviews (1)
byjagnikam, October 29, 2015
In script help its been mentioned that "-p" for password and "-l" for port but in scripting they used "-p" for port and "-w" for password. need small correction. Otherwise everything seems to be working.

Thanks for the great script.