Re: troubleshooting ssl to port 2484 using tnsping

  • From: Rodrigo Mufalani <rodrigo@xxxxxxxxxxxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 17 Aug 2017 16:54:02 +0000

Hi,

   Sometime ago I need to check a specific port and had no telnet installed on 
machine. So, decided to use curl:

Mufalani03:~ mufalani$ curl -v telnet://192.168.0.100:1521
* Rebuilt URL to: telnet:// 192.168.0.100:1521/
*   Trying 192.168.0.100...
* TCP_NODELAY set
* Connected to 192.168.0.100 (192.168.0.100) port 1521 (#0)

All the best,
[RED]

Rodrigo Mufalani -  Dir. Técnico
rodrigo@xxxxxxxxxxxxxxx
+55 21 988 994 817

Mufalani
+55 21 3193 0326
Rua Almirante Grenfall, 405, Bloco 3, Sala 310
Centro Empresarial Washington Luiz
Duque de Caxias - RJ
CEP 25085-009
www.mufalani.com.br<http://www.mufalani.com.br/>


[id:image002.png@01D2F4C6.8E6B3BE0]



De: <oracle-l-bounce@xxxxxxxxxxxxx> em nome de Mladen Gogala 
<gogala.mladen@xxxxxxxxx>
Responder para: "gogala.mladen@xxxxxxxxx" <gogala.mladen@xxxxxxxxx>
Data: quinta-feira, 17 de agosto de 2017 12:33
Para: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
Assunto: Re: troubleshooting ssl to port 2484 using tnsping


Actually, "nc" is much better than "telnet".  The "netcat" utility, also known 
as "nc" is a veritable Swiss army knife of networking. The command to verify 
whether the port is responding would be

nc -v -z -w 3 myhost 2484



That would send out a verbose output (-v) for using zero size messages (-z) and 
waiting for 3 seconds for a reply (-w 3). Here is an example:

mgogala@umajor:~$ nc -v -z -w 3 umajor 80
Connection to umajor 80 port [tcp/http] succeeded!
mgogala@umajor:~$

Before the SQLcl command interpreter that has tnsping built in, I was using  a 
nc-based Perl script called "tnsping" to do that. And it worked just fine, 
parsing the relevant part of tnsnames.ora was not a problem. For all those 
Python lovers,there is even a CPAN module for netcat:

http://search.cpan.org/~vgirish/Net-Netcat-0.05/lib/Net/Netcat.pm

And some comments about the eternal Perl vs. Python debate: Python is 
consistently object oriented. Perl is not. Given that the most of the 
application software is written using the OO paradigm, Python is probably 
better for the application writing. However, quick one-off scripts, so 
frequently written by system and database administrators are usually not object 
oriented and do not have well defined set of objects to operate on. For such 
tasks Perl, with its unsurpassed ability to parse strings and the myriad of 
readily available CPAN modules, is still the best tool for the job. That is why 
Perl so stubbornly refuses to die, despite the fact that so many "programming 
gurus" have declared it obsolete. Perl has users, droves of them. Lastly, the 
idea that indentation matters reminds me of Completely Oudated and Badly 
Overused Language, or COBOL, for short.

OO languages also tend to be very verbose. Both Java and Python are good 
examples. Perl can be very short and concise. Snippet like this:

while (<>) {

    chomp;

    next  if /^\s*#/;

    if (/..../) {

         do_something;

   }

}

is definitely not following the OO canon, but is very useful and frequently 
used in Perl scripts. I have yet to find language which can cram more 
operations in such a small amount of code.

Finally, to end on the Trumpian note: we should use things made in America, by 
a guy named Larry, not some suspicious foreign stuff, invented by a guy named 
Guido. And we can build beautiful scripts, the best scripts in the world and 
Guido will pay for them....



On 08/16/2017 03:01 PM, MacGregor, Ian A. wrote:
Do you have  access to telnet?  What happens when you run

telnet myhost  2484

on the client.  I suspect  it is because the connection  does not hang.  Have 
you looked at

http://www.petefinnigan.com/forum/yabb/YaBB.cgi?board=tools_free;action=print;num=1128363187


Ian MacGregor
SLAC National Accelerator Laboratory.


On Aug 16, 2017, at 10:19 AM, Jared Still 
<jkstill@xxxxxxxxx<mailto:jkstill@xxxxxxxxx>> wrote:

Hi Michael,

What is the output from 'adapters' ?



Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
Principal Consultant at Pythian
Pythian Blog http://www.pythian.com/blog/author/still/
Github: https://github.com/jkstill
Oracle Blog: http://jkstill.blogspot.com<http://jkstill.blogspot.com/>
Home Page: http://jaredstill.com<http://jaredstill.com/>

On Mon, Aug 14, 2017 at 11:01 AM, Michael McMullen 
<ganstadba@xxxxxxxxxxx<mailto:ganstadba@xxxxxxxxxxx>> wrote:
Oracle 11.2.0.4 (Oracle restart ie. +ASM but single host)
OEL 6.5


I'm troubleshooting tcps setup with Oracle. At this point I'm really trying to 
just narrow my troubleshooting if port 2484 is listening for tcps.
No server certs at this time.

Can I just add to the listener.ora file the following (if I've made a typo 
below assume I have it ok on my server)

(ADDRESS = (PROTOCOL = TCPS)(HOST = myhost)(PORT = 2484))

restart the listener, see that it's listening on port 2484 and then

tnsping "(DECRIPTION=(ADDRESS = (PROTOCOL = TCPS)(HOST = myhost)(PORT = 2484))"

when I do the above tnsping I get TNS-12560: TNS:protocol adapter error
while it returns OK (0 msec) when I use tcp and 1521 which is expected.

Just looking for the minimum I need to do to get the tnsping to return ok so I 
can limit my troubleshooting.

Thanks

Mike





--

Mladen Gogala

Oracle DBA

Tel: (347) 321-1217

PNG image

PNG image

Other related posts: