LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-31-2011, 01:54 AM   #1
indrajit.jadhav
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
Monitoring oracle database on windows using Nagios(Linux)


Hi all,

I have installed Nagios on linux.
I want to monitor Oracle database on windows using Nagios.
Please suggest me different ways to do the same.
 
Old 10-31-2011, 02:11 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and Welcome to LinuxQuestions,

There are several possibilities. You could write your own plugin running custom queries if you have the Oracle client and sqlplus installed. Another option is to download one of the several plugins available from NagiosExchange. For your convenience, here's an example I used with the Oracle client and sqlplus installed.
Code:
#!/bin/sh
#
# ## Plugin for Nagios to execute SQL string against Oracle DB
# ##
# ## - 2010-07-05 coded and tested for Linux
#
#
# ## You are free to use this script under the terms of the Gnu Public License.
# ## No guarantee - use at your own risc.
#
# ## Description:
#
# This plugin executes a specific SQL query against an Oracle DB using sqlplus.
#
# Paths to commands used in this script.  These
# may have to be modified to match your system setup.

PATH=""

find="/usr/bin/find"
xargs="/usr/bin/xargs"
tail="/usr/bin/tail"
awk="/usr/bin/awk"
cut="/usr/bin/cut"
wc="/usr/bin/wc"
grep="/bin/grep"
sqlplus="/usr/bin/sqlplus"

PROGNAME=`/usr/bin/basename $0`
PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION="Revision 1.0"
AUTHOR="(c) 2007 Bernd Mueller (http://www.lisega.de/)"

# Exit codes
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4

print_revision() {
    echo "$REVISION $AUTHOR"
}

print_usage() {
    echo "Usage: $PROGNAME"
    echo "Usage: $PROGNAME --help"
    echo "Usage: $PROGNAME --version"
}

print_help() {
    print_revision $PROGNAME $REVISION
    echo ""
    echo "Plugin for Nagios to run SQL query against Oracle DB using sqlplus"
    echo ""
    print_usage
    echo ""
}

# DB Query:

queryresult=`$sqlplus I2TM_CRP/infrsopo@I2A631P <<EOF
;
EOF`

# Check result:

result="ok"
exitstatus=$STATE_OK

##### Compare with thresholds

if [ "$queryresult" = "" ]; then
	echo ""
        result="critical"
        exitstatus=$STATE_CRITICAL;
else
	echo ""
	result="ok"
	exitstatus=$STATE_OK
fi

exit $exitstatus
Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric
 
Old 10-31-2011, 03:28 AM   #3
indrajit.jadhav
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi

do i need to install NRPE on oracle machine,
or will it work with NSClient++ only.
 
Old 10-31-2011, 05:25 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

NSClient++ is for Windows only AFAIK while NRPE has a Windows (NRPE_NT) and Linux/Unix version. So depending on what OS you have your Oracle running on you'll need to install the correct version of the plugins.

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitoring Windows Backup with Nagios Penhexy Linux - Software 3 03-01-2012 09:29 PM
Nagios monitoring Windows processes jerudolph General 5 10-12-2011 04:15 PM
Nagios oracle monitoring on windows investmentbnker75 General 3 04-14-2009 05:01 AM
Windows Oracle database access from Linux edsalvador Linux - Networking 1 03-16-2008 11:54 AM
LXer: Free Linux / Windows Oracle Database 10g Express Edition LXer Syndicated Linux News 0 05-16-2006 10:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration