Help for implementing a check of an Oracle query

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Help for implementing a check of an Oracle query

Postby gio123bg » Fri Mar 09, 2012 9:49 am

Hi All,
I'm a newbie in this forum and I have been trying to find a documentation for implementing a check of an Oracle query on Nagios environment.

The requirement is very simple.

This is the Oracle query

select count(*) from IM_BC_JOB;

If count_number >= 10 then RED alert
if count_number < 10 then GREEN alert

Any help or suggestion to customize Nagios step by step will be well appreciated.

Thanks in advance for your kind support.

Regards,

Giovanni
gio123bg
 
Posts: 2
Joined: Fri Mar 09, 2012 5:30 am

Re: Help for implementing a check of an Oracle query

Postby mguthrie » Fri Mar 09, 2012 11:18 am

I'll be moving this to the Nagios Core forum for better visibility.

Usually the community uses the following plugin for Oracle related checks, although I know there is some setup involved.
http://exchange.nagios.org/directory/Plugins/Databases/Oracle/check_oracle_health/details
mguthrie
 
Posts: 4381
Joined: Mon Jun 14, 2010 10:21 am

Re: Help for implementing a check of an Oracle query

Postby gio123bg » Wed Apr 04, 2012 11:38 am

Hi,
thanks again for your suggestion.

I have a Nagios environment already installed, I suppose with Oracle connection. I have find this link

http://exchange.nagios.org/directory/Da ... ry/details

where suggest me to use check_sql_query access_file query_file

Maybe this is the solution to run an "query_file" (korn shell with sql query) and return a value.

My problem at the moment is to find a suggestion about the configuration steps to follow for implementing this service.

Any help will be well appreciated in starting the configuration.

Thanks in advance for your kind support.

Regards,

Giovanni
gio123bg
 
Posts: 2
Joined: Fri Mar 09, 2012 5:30 am

Re: Help for implementing a check of an Oracle query

Postby gridd » Mon Sep 03, 2012 11:17 am

I did something what you ask many years ago, so I cannot remember in details.
But the general idea is to use sqlplus - an Oracle tool for batch querying.
It runs sql script and returns data to standard output. there are lot of formatting options also, so you can fine tune your output data in almost any way.

example:

#create some script
cat <<EOF > local_script.sql
select count(*) from IM_BC_JOB;
EOF
#call sqlplus with script
sqlplus -s scott/tiger @local_script.sql > ora_results

#you may use awk,perl or any to parse returned Oracle table values
#and return proper values to nagios

try to find any book on Oracle scripting, some of them are availale on the net.

I'm not shure this code correct and could run, but I hope you will get an idea how to start.


gio123bg wrote:Hi,
thanks again for your suggestion.

I have a Nagios environment already installed, I suppose with Oracle connection. I have find this link

http://exchange.nagios.org/directory/Da ... ry/details

where suggest me to use check_sql_query access_file query_file

Maybe this is the solution to run an "query_file" (korn shell with sql query) and return a value.

My problem at the moment is to find a suggestion about the configuration steps to follow for implementing this service.

Any help will be well appreciated in starting the configuration.

Thanks in advance for your kind support.

Regards,

Giovanni
gridd
 
Posts: 6
Joined: Sun Aug 19, 2012 8:38 pm


Return to Nagios Core

Who is online

Users browsing this forum: Bing [Bot] and 3 guests