Problem executing query using check_xi_oraclequery

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
thrivikramr
Posts: 27
Joined: Thu Jan 24, 2013 9:02 am

Problem executing query using check_xi_oraclequery

Post 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...!
Thanks,
ThriVikram
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problem executing query using check_xi_oraclequery

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
thrivikramr
Posts: 27
Joined: Thu Jan 24, 2013 9:02 am

Re: Problem executing query using check_xi_oraclequery

Post by thrivikramr »

We are trying to do so.. let me get back to you on this.

Thankyou
Thanks,
ThriVikram
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problem executing query using check_xi_oraclequery

Post by abrist »

No problem. Let us know.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
thrivikramr
Posts: 27
Joined: Thu Jan 24, 2013 9:02 am

Re: Problem executing query using check_xi_oraclequery

Post 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.
Thanks,
ThriVikram
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problem executing query using check_xi_oraclequery

Post by abrist »

No problem. Enjoy the week. Locking thread.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked