- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: telnet xx.xx.xx port, how break the connection...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 03:46 AM
тАО10-08-2009 03:46 AM
Very Good evening to allтАж.
I need your help regarding checking the port for destination are working properly.
Ex telnet 10.xx.xx.x 80
The challenge here is I have more than 500 ports which need to be checked for different destination servers.
The below script is not helping as once I do telnet destination_server port, if itтАЩs connected, I am unable to break the connection in shell script.
if telnet 10.188.36.14 80 < /dev/null 2>&1 | grep -i Connected
then
echo its fine
else
echo port 80 is down!
Fi
Could some let me know if any scripts available for this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 03:54 AM
тАО10-08-2009 03:54 AM
Re: telnet xx.xx.xx port, how break the connection in script?
What exactly are you trying to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 04:02 AM
тАО10-08-2009 04:02 AM
Re: telnet xx.xx.xx port, how break the connection in script?
There are few destination servers, I need to check for port connectivity.
There are more number of ports which I need to be checked, I can├в t do this manually as more number of ports which I need to check for all.
telnet xx.xx.xx.x portnumber
Trying...
Connected to xx.xx.xx.x.
Escape character is '^]'.
SSH-2.0-Sun_SSH_1.1
Unable to break here in script.
can you please tell me one freeware s/w where I can achieve this?
Note:- just I need check the connectivity for specific port numbers, whether it├в s connecting or not. Nothing else
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 04:20 AM
тАО10-08-2009 04:20 AM
Re: telnet xx.xx.xx port, how break the connection in script?
cat sock.pl
#!/usr/bin/perl
my ($host,$port);
$host=10.188.36.14 ;
$port=80;
my $sock=IO::Socket::INET->new("$host:$port") or die "" ;
This will return an zero/non-zero exit code !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 04:23 AM
тАО10-08-2009 04:23 AM
Re: telnet xx.xx.xx port, how break the connection in script?
http://nmap.org/
http://nmap.org/book/man-port-scanning-techniques.html
It is available for HP-UX but it has a lot of dependancies http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/nmap-4.76/
You are better off to install it on a windows PC or Linux.
http://nmap.org/download.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 04:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 04:42 AM
тАО10-08-2009 04:42 AM
Re: telnet xx.xx.xx port, how break the connection in script?
-script is here attached: and you can call it with this wrapper, it is suitable for port scanning also; from port to port :
#!/bin/ksh
# Port Scanner with PERL
#
echo From Port
read prt1
echo To Port
read prt2
echo IP
read ip
# Init Log File step
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 07:20 AM
тАО10-08-2009 07:20 AM
Re: telnet xx.xx.xx port, how break the connection in script?
I got 95% almost what I want is hee hee. Just one thing, there could be several reasons for which are the ports not connecting
ex
connection refused,
connection timed out
not able to connect
is ter any way I can trace this as well? Instead just to know whether connection is there or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 07:52 AM
тАО10-08-2009 07:52 AM
Re: telnet xx.xx.xx port, how break the connection in script?
http://nmap.org/book/man-port-scanning-basics.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2009 11:55 AM
тАО10-08-2009 11:55 AM
Re: telnet xx.xx.xx port, how break the connection in script?
wrapper was missing somehow probably my typo , you can use them together at least to get a list for a given range of ports :
#!/bin/ksh
# Port Scanner with PERL
#
echo From Port
read prt1
echo To Port
read prt2
echo IP
read ip
# Init Log File step
>/tmp/port_check.$ip > /dev/null
while [ $prt1 -lt $prt2 ]
do
echo $ip:$prt1 >> /tmp/port_check.$ip
/aydin/chk_rem_port $ip $prt1 >> /tmp/port_check.$ip
wait
prt1=$(($prt1+1))
done