Page 1 of 1

Created a script to query a table, can't pass sql query

Posted: Fri Dec 11, 2015 7:51 pm
by ideal2545
Hi Guys,

I check command script to query our database and if it finds a result, do something with it. The issue I'm having is that I want to pass the SQL Query through an argument, but when I do and the SQL query contains something like an asterisk or parenthesis, Nagios automatically tries to escape it and thusly ruins the sql statement: example

query is:
select count(*) from dual

nagios does the following when I pass it in as an argument: ORA_ERROR="select count\(\*\) from dual

Does anyone know of a way to disable it from adding the escape characters?

Re: Created a script to query a table, can't pass sql query

Posted: Mon Dec 14, 2015 10:36 am
by hsmith
Can you paste the entire check command definition here for us to review?