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.
#create some script
cat <<EOF > local_script.sql
select count(*) from IM_BC_JOB;
#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.
thanks again for your suggestion.
I have a Nagios environment already installed, I suppose with Oracle connection. I have find this linkhttp://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.