moving projects
This commit is contained in:
33
anduril/status_query.py
Executable file
33
anduril/status_query.py
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/python
|
||||
#echo client program
|
||||
import socket
|
||||
import sys
|
||||
|
||||
if len(sys.argv)<2:
|
||||
message='HELO'
|
||||
else:
|
||||
message=sys.argv[1]
|
||||
|
||||
|
||||
hosts=['vm1',
|
||||
'vm2',
|
||||
'vm3',
|
||||
'vm4',
|
||||
'vm5',
|
||||
'vm6',
|
||||
'narsil']
|
||||
|
||||
PORT = 50774 # The same port as used by the server
|
||||
|
||||
for HOST in hosts:
|
||||
try:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((HOST, PORT))
|
||||
s.settimeout(10)
|
||||
s.send(message)
|
||||
data = s.recv(1024)
|
||||
sys.stdout.write(data)
|
||||
s.close()
|
||||
except:
|
||||
sys.stdout.write('|'+HOST+' does not answer. ')
|
||||
|
||||
Reference in New Issue
Block a user