oracle query plugin error?!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

oracle query plugin error?!

Post 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?
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: oracle query plugin error?!

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: oracle query plugin error?!

Post 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.
You do not have the required permissions to view the files attached to this post.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: oracle query plugin error?!

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: oracle query plugin error?!

Post 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%'" !!!!!!!!!
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: oracle query plugin error?!

Post 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.
xpertech
Posts: 399
Joined: Thu Sep 01, 2011 9:47 pm

Re: oracle query plugin error?!

Post 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?!
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: oracle query plugin error?!

Post 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%'"
Former Nagios employee
Locked