error"TNS:listener was not given the SERVICE_NAME"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
naveenreddyv
Posts: 18
Joined: Wed Jan 16, 2013 6:25 am

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

Post 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
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post 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.
naveenreddyv
Posts: 18
Joined: Wed Jan 16, 2013 6:25 am

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

Post 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
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post 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.
naveenreddyv
Posts: 18
Joined: Wed Jan 16, 2013 6:25 am

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

Post 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
naveenreddyv
Posts: 18
Joined: Wed Jan 16, 2013 6:25 am

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

Post 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
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post 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
naveenreddyv
Posts: 18
Joined: Wed Jan 16, 2013 6:25 am

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

Post 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
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Thanks for helping danieloo!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked