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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ideal2545
Posts: 1
Joined: Thu Feb 19, 2015 9:50 pm

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

Post 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?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Can you paste the entire check command definition here for us to review?
Former Nagios Employee.
me.
Locked