moving projects

This commit is contained in:
ville rantanen
2013-09-03 10:04:14 +03:00
parent 3e36193fe4
commit 30cb1e6128
13 changed files with 570 additions and 0 deletions

33
anduril/status_query.py Executable file
View 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. ')