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

error"TNS:listener was not given the SERVICE_NAME"

Post by naveenreddyv »

Hi Team,

Nagios Details:
Nagios XI Version : 2012R1.6
2.6.32-279.19.1.el6.x86_64 x86_64
CentOS release 6.3 (Final) 64bit
Manual install of XI
Gnome is not installed

We are trying to monitor oracle query and we are receiving the below error.

"CRITICAL - cannot connect to IPAddress:1521. ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA (DBD ERROR: OCIServerAttach)"

We have installed oracle plugins and set the home path as well.

Thanks,
Naveen Reddy
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

What is the full check command you are using? (feel free to obfuscate login credentials)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
naveenreddyv
Posts: 18
Joined: Wed Jan 16, 2013 6:25 am

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

Post by naveenreddyv »

Please find the check command...

check_xi_oraclequery!-connect IPAddress:1521 --username username --password "password" --mode sql --name="query" --warning 50 --critical 200
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post by danieloo »

Use this patch (see attached)..
place it in: /usr/local/nagiosxi/html/includes/configwizards/oracle_serverspace/
run: patch oracle_serverspace.inc.php < oracle_serverspace.inc.php.patch

This will make the sid (servicename) available from withing the wizard and will change the comamnd to:
check_xi_oraclequery!-connect IPAddress:1521/sid --username username --password "password" --mode sql --name="query" --warning 50 --critical 200
Last edited by danieloo on Tue Feb 26, 2013 9:44 am, edited 1 time in total.
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 did not find any attachment. please add the attachment
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Thanks for the tips danieloo, I also look forward to seeing this patch :).
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post by danieloo »

here is the patch
oracle_serverspace.inc.php.txt
sorry it took so long the extensions were not allowed
rename to .patch instead of txt..
I am pretty new at using diff and patch so sorry for that...
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

This patch should probably be uploaded to the exchange and noted on http://tracker.nagios.com
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
danieloo
Posts: 27
Joined: Mon Feb 13, 2012 11:12 am

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

Post by danieloo »

done..
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 tried to do the patch and got the below response...

e_serverspace.inc.php.patch
patching file oracle_serverspace.inc.php
patch: **** `>' expected at line 11 of patch
Locked