Page 1 of 1

check_oracle_health and XI command interpretation issues

Posted: Mon Jul 28, 2014 2:39 pm
by dworthcsl
Hi,

I just installed the the required plugins needed for the Oracle check. I am following the Nagios instructions. After I was able to figure out the session errors, I am now running into issues with the command string executing. Here is the string I am running:

Code: Select all

-connect "host:1521/db1" --username dbusr --password "passwd" --mode sql --name="select count(1) from v\$session" --warning 50 --critical 200
When I try to setup and test with in CCM I get the following error:

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib ORACLE_HOME=/usr/lib/oracle/11.2/client $USER1$/check_oracle_health $ARG1$

ARG1 -> -connect "host:1521/db1" --username dbusr --password "passwd" --mode sql --name="select count(1) from v\$session" --warning 50 --critical 200

The error I get is as follows:

COMMAND: /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 "host:1521/db1" --username dbusr --password "passwd" --mode sql --name="select count\(1\) from v\\\$session" --warning 50 --critical 200
OUTPUT: UNKNOWN - got no valid response for select count\(1\) from v\$session - ORA-00911: invalid character (DBD ERROR: error possibly near <*> indicator at char 12 in 'select count<*>\(1\) from v\$session')

If I run the same command, cut and pasted from the ARG1 line as the nagios user on the command line, it works. Here is the output:

Code: Select all

./check_oracle_health -connect "host:1521/db1" --username dbusr --password "passwd" --mode sql --name="select count(1) from v\$session" --warning 50 --critical 200
OK - select count(1) from v$session: 36 | 'select'=36;50;200
This seems like something is happening with the formating of the command within XI.

I am running this on RHEL 6.5 64 and the version of XI is 2014 r1.3

Thanks,
David

Re: check_oracle_health and XI command interpretation issues

Posted: Mon Jul 28, 2014 3:05 pm
by sreinhardt
The additional formatting is purely a test command button issue with special characters. If you can run it like that from the cli, you should have no issues saving that as a service definition and letting nagios run the actual check instead of using the test command button.

Re: check_oracle_health and XI command interpretation issues

Posted: Mon Jul 28, 2014 3:14 pm
by dworthcsl
You are correct. :) I knew I checked it. I guess one of those days. Thanks again.

Re: check_oracle_health and XI command interpretation issues

Posted: Mon Jul 28, 2014 3:16 pm
by sreinhardt
No problem, test command can throw you off a bit!