Hello Nagios Crew,
I am facing a problem in implementing a oracle check on a specific select.
The command is:
/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 '10.211.145.33:1521/SBX' --username 'userxx' --password 'passxx' --mode sql --name="SELECT INSTANCE_NAME, STATUS, DATABASE_STATUS FROM V\$INSTANCE "
UNKNOWN - got no valid response for SELECT INSTANCE_NAME, STATUS, DATABASE_STATUS FROM V$INSTANCE
To check that I implemented all parts correctly I tested:
/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 '10.211.145.33:1521/SBX' --username 'userxx' --password 'passxx' --mode sql --name="select count(*) from v\$session"
CRITICAL - select count(*) from v$session: 40 | 'select'=40;1;5
Which works for what I can see.
Can you please help?
Thanks
Sandro
Oracle Select not working
Re: Oracle Select not working
One thing to check is to see if the user account has sufficient rights to V$INSTANCE for it to run the select.
Also, what version of the plugin are you running?
To check that, run the check with the -V option and it will show you the version.
If you are not running the latest plugin, you can go to the following link to download the latest one.
https://labs.consol.de/nagios/check_oracle_health/
Also, what version of the plugin are you running?
To check that, run the check with the -V option and it will show you the version.
If you are not running the latest plugin, you can go to the following link to download the latest one.
https://labs.consol.de/nagios/check_oracle_health/
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: Oracle Select not working
Hello tgriep,
I think I found the reason it was not working.
The command expects as an output a number, the select I am trying will give a string as a reply.
So I had to add the count (*) instruction which will count the number of times a certain string appears.
The new command is:
/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 'XXXHOSTXXX:1521/XXINSTANCE' --username 'userxx' --password 'passxx' --mode sql --name="select count(*) from v\$INSTANCE where status = 'OPEN'"
Case closed.
Thanks
Sandro
I think I found the reason it was not working.
The command expects as an output a number, the select I am trying will give a string as a reply.
So I had to add the count (*) instruction which will count the number of times a certain string appears.
The new command is:
/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 'XXXHOSTXXX:1521/XXINSTANCE' --username 'userxx' --password 'passxx' --mode sql --name="select count(*) from v\$INSTANCE where status = 'OPEN'"
Case closed.
Thanks
Sandro
Re: Oracle Select not working
Great to hear! Did you have further (related) questions or are we good to lock this up?
Former Nagios employee
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: Oracle Select not working
Lock it up.
thanks
Sandro
thanks
Sandro