Page 1 of 1

Problem executing query using check_xi_oraclequery

Posted: Fri Apr 05, 2013 12:22 pm
by thrivikramr
Hi,

I have a small problem while executing a oracle query. I am not getting any output on nagios.

Here are the details.

COMMAND: /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib ORACLE_HOME=/usr/lib/oracle/11.2/client64 /usr/local/nagios/libexec/check_oracle_health -connect IP:PORT/DBNAME --username ABCD --password "ABDC" --mode sql --name="select nvl(max(last_ran), 0) from (select (sysdate - max(last_update_timestamp)) * 1440 last_ran from flowrun_metrics where brand_name != 'ABA_CDE_FGH' and last_update_timestamp > sysdate - 1 group by brand_name)" --critical 30
OUTPUT: UNKNOWN - got no valid response for "select - ORA-01740: missing double quote in identifier (DBD ERROR: OCIStmtPrepare) which is showing as (null)

where as my expected output should look like (NVL(MAX(LAST_RAN),0))=1.65|NVLMAXLASTRAN0=1.65;;;0

What am I missing here...!

Re: Problem executing query using check_xi_oraclequery

Posted: Mon Apr 08, 2013 9:53 am
by abrist
Looks like either the connect or mode strings are missing or need a double quote, or the name directive is getting truncated. Can you limit the query or name string to something much simpler for troubleshooting purposes?

Re: Problem executing query using check_xi_oraclequery

Posted: Thu Apr 11, 2013 8:58 am
by thrivikramr
We are trying to do so.. let me get back to you on this.

Thankyou

Re: Problem executing query using check_xi_oraclequery

Posted: Thu Apr 11, 2013 11:07 am
by abrist
No problem. Let us know.

Re: Problem executing query using check_xi_oraclequery

Posted: Tue Apr 16, 2013 2:50 pm
by thrivikramr
Nagios was failing to recognise ! in the query.

brand_name != 'ABA_CDE_FGH' replaced it with brand_name <> 'ABA_CDE_FGH' and it worked for us.

Thanks for your help.

Re: Problem executing query using check_xi_oraclequery

Posted: Tue Apr 16, 2013 3:56 pm
by abrist
No problem. Enjoy the week. Locking thread.