Page 1 of 1

Oracle Query UNKNOWN - got no valid response for

Posted: Thu Apr 04, 2019 7:33 am
by lelouvenice
[[email protected] ~]$ /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib ORACLE_HOME=/usr/lib/oracle/12.2/client64 /usr/local/nagios/libexec/check_oracle_health --connect 'xxxxxxxxxxx:1521/aves.kite.cz' --username 'crml_owner' --password 'aves' --mode sql --name="select * from CRML_ORDER"
UNKNOWN - got no valid response for select * from CRML_ORDER
Can someone tell me what have i done wrong here?

Re: Oracle Query UNKNOWN - got no valid response for

Posted: Thu Apr 04, 2019 4:47 pm
by cdienger
In mode sql you can url-encode the statement so you will not have to mess
around with special characters in your Nagios service definitions.
Instead of
--name="select count(*) from v$session where status = 'ACTIVE'"
you can say
--name=select%20count%28%2A%29%20from%20v%24session%20where%20status%20%3D%20%27ACTIVE%27
For your convenience you can call check_oracle_health with --mode encode
and it will encode the standard input.
Try:

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib ORACLE_HOME=/usr/lib/oracle/12.2/client64 /usr/local/nagios/libexec/check_oracle_health --connect 'xxxxxxxxxxx:1521/aves.kite.cz' --username 'crml_owner' --password 'aves' --mode sql --name="select * from CRML_ORDER"
UNKNOWN - got no valid response for select %2A from CRML_ORDER