Page 1 of 1

oracle query plugin error?!

Posted: Thu Jun 12, 2014 6:17 pm
by xpertech
The command below can query db data from Oracle,

select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'

but when using on NagiosXI oracle query plugin, seems not work?

Re: oracle query plugin error?!

Posted: Thu Jun 12, 2014 8:15 pm
by Box293
Can you please post a screenshot of your service definition so we can see what has been defined.

Also, have you tested this at the cli? Can you please give us an example of what you are typing at the cli and what is being returned?

Re: oracle query plugin error?!

Posted: Fri Jun 13, 2014 10:40 am
by xpertech
We use command in Oracle: select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'

In NagiosXI service definition: check_xi_oraclequery!-connect 172.17.1.17:1521/mvf.world --username user --password "password" --mode sql --name="select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'" !!!!!!!!!

We want to check Oracle available free partitions which acted as cache, partitions will be occupied and then cleared when full.
There Oracle will get problem when the partitions full and didn't being clear up.

We want to monitor available free partitions and get alert.

Re: oracle query plugin error?!

Posted: Fri Jun 13, 2014 12:56 pm
by sreinhardt
I believe check_oracle is expecting a single integer or string returned. This looks like it would output the whole table, which the plugin almost definitely would not understand what to do with, and makes sense that it thinks that the returned output is invalid. Can you try checking just a single disk instead, preferably with just the total values you wish to see and not the whole table?

Re: oracle query plugin error?!

Posted: Thu Jun 19, 2014 6:42 am
by xpertech
Sorry, maybe I didn't explain clearly, let me explain again ...

We use Oracle command and will return a free space value (1.gif) :
select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'

We use command on NagiosXI service definition but return error (2.gif):
check_xi_oraclequery!-connect 172.17.1.17:1521/mvf.world --username user --password "password" --mode sql --name="select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'" !!!!!!!!!

Re: oracle query plugin error?!

Posted: Thu Jun 19, 2014 4:59 pm
by slansing
Is that exactly what your manual query outputs too? The same one you attached to that plugin check? If so, we are going to need to try and sculpt that down a bit to size, the plugin will have no idea what to do with that as sreinhardt mentioned. Let us know.

Re: oracle query plugin error?!

Posted: Wed Jul 02, 2014 10:19 am
by xpertech
From the Oracle GUI console, the query command will respond only one number ...

but when using this command on NagiosXI, there will be no valid response?!

Re: oracle query plugin error?!

Posted: Wed Jul 02, 2014 5:02 pm
by tmcdonald
I want to make sure of two things:

1.) When you quoted the following:

Code: Select all

check_xi_oraclequery!-connect 172.17.1.17:1521/mvf.world --username user --password "password" --mode sql --name="select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'" !!!!!!!!!
were you replacing user and "password" with the proper values?

2.) Please run the following from the Nagios command line and post the actual text output, not a screenshot, and replace the user and password entries with the proper values:

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib ORACLE_HOME=/usr/lib/oracle/11.2/client /usr/local/nagios/libexec/check_oracle_health -connect 172.17.1.17:1521/mvf.world --username user --password "password" --mode sql --name="select sum(free_space) from OSR_CACHE_VOLUME where dir_name like '/cache%'"