Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P5991
very simple TCP connection tester
Active
Public
Actions
Authored by
akosiaris
on Sep 12 2017, 1:52 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
Kubernetes
Referenced Files
F9481973: very simple TCP connection tester
Sep 12 2017, 1:52 PM
2017-09-12 13:52:43 (UTC+0)
Subscribers
None
from
telnetlib
import
Telnet
import
socket
SERVERS
=
{
'webproxy.eqiad.wmnet'
:
8080
,
'208.80.154.251'
:
443
,
'www.ntua.gr'
:
80
,
'10.64.64.200'
:
8000
,
'10.64.64.201'
:
8001
,
}
def
lala
():
for
i
,
v
in
SERVERS
.
items
():
try
:
t
=
Telnet
(
i
,
v
,
2
)
print
(
'Connection to
%s
:
%s
successful'
%
(
i
,
v
))
except
socket
.
error
as
e
:
print
(
'Connection to
%s
:
%s
failed:
%s
'
%
(
i
,
v
,
e
))
Event Timeline
akosiaris
created this paste.
Sep 12 2017, 1:52 PM
2017-09-12 13:52:43 (UTC+0)
Log In to Comment