Re: troubleshooting ssl to port 2484 using tnsping

From: Rodrigo Mufalani <rodrigo_at_mufalani.com.br>
Date: Thu, 17 Aug 2017 16:54:02 +0000
Message-ID: <3A9CD61E-FFFC-48B3-B633-EF1AE0C5C21E_at_mufalani.com.br>





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_at_mufalani.com.br
+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_at_01D2F4C6.8E6B3BE0]

De: <oracle-l-bounce_at_freelists.org> em nome de Mladen Gogala <gogala.mladen_at_gmail.com> Responder para: "gogala.mladen_at_gmail.com" <gogala.mladen_at_gmail.com> Data: quinta-feira, 17 de agosto de 2017 12:33 Para: "oracle-l_at_freelists.org" <oracle-l_at_freelists.org> 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_at_umajor:~$ nc -v -z -w 3 umajor 80 Connection to umajor 80 port [tcp/http] succeeded! mgogala_at_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_at_gmail.com<mailto:jkstill_at_gmail.com>> 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_at_hotmail.com<mailto:ganstadba_at_hotmail.com>> 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





--
http://www.freelists.org/webpage/oracle-l


Received on Thu Aug 17 2017 - 18:54:02 CEST

Original text of this message