Page 3 of 3

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 2:14 am
by naveenreddyv
Hi,

I am using the below command for oracle quety monitoring

check_xi_oraclequery!-connect IPaddress:1521/sid --username username --password "password" --mode sql --name="query" --warning 50 --critical 200

below is the error message I am receiving for the above query

CRITICAL - cannot connect to IPaddress:1521/sid. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)


Thanks,
Naveen Reddy

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 2:54 am
by danieloo
the errors after applying the patch can have two reasons..
1. you applied the wrong patch on the wrong file
2. you are applying the patch on a different version then 1.2 of the oracle query wizard

The oracle error is cause by an incorrect name.. the sid should be replayed by the service_name commonly found in the tnsnames.ora.

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 3:30 am
by naveenreddyv
I am doing it to the right file and I am not sure about the version.
Please let me know if there is any way to check the version?
service_name is the database name, if it is not please let me know how to find the service name

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 3:39 am
by danieloo
In the file you are trying top patch is says which version it is, it is either 1.0, 1.1 or 1.2
you can try updating it by going in to nagios admin. you can find the Manage Config Wizards under System Extensions in the left menu.
After clicking on Check for Updates you can scroll down to the Oracle wizards if there is and update the box colors green.

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 4:38 am
by naveenreddyv
got it...

all the oracle wizards are showing 1.1 version and I have updated the query and server space to 1.2 and the tablespace has no updates....

service_name is the database name, if it is not please let me know how to find the service name

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 4:42 am
by naveenreddyv
after updating the version, now I am receiving the different error

CRITICAL - cannot connect to IPaddress:1521/sid. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 4:45 am
by danieloo
awesome.. it is correct that tablespace is still v1.1

the service_name should index be the database name (not the servername) you must be able to find it on the oracle server it self in a file called tnsnames.ora
if it is a linux box you can do a "ps aux" you will find processes like: ora_pmon_xxxxx
The xxxx is the servicename

Have you installed the oracleinstantclient on your nagiosxi server following this tutorial:
http://assets.nagios.com/downloads/nagi ... lation.pdf

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 5:11 am
by naveenreddyv
cool... then I am using the database name and I have already install the oracleinstantclient....

I am still receiving the below error

CRITICAL - cannot connect to IPaddress:1521/dbname. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 9:27 am
by danieloo
have you made sure your environment settings are correct ?!?
You can try them on command-line like so:

export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib
export ORACLE_HOME=/usr/lib/oracle/11.2/client
/usr/local/nagios/libexec/check_oracle_health --connect "ipadres:1521/service_name" --username nagios --password "nagios" --mode connected-users --warning 50 --critical 100

and please check if Oracle.so is indeed present on the same location.. if not you should probably install it with something like (need the environment variables set like above first though):

cpan DBD::Oracle

Re: error"TNS:listener was not given the SERVICE_NAME"

Posted: Wed Mar 06, 2013 11:55 am
by scottwilkerson
Thanks for helping danieloo!