import zmq
import sys
import json

def niceprint(data):
	return json.dumps(data,sort_keys=True,indent=4, separators=(',', ': ')).__str__()

if len(sys.argv) < 3:
    print("Usage: %s <control_port> <query> [key1=value1 key2=value2]" %sys.argv[0])
    sys.exit(1)

context = zmq.Context()
socket = context.socket(zmq.REQ)    
socket.connect("tcp://127.0.0.1:%s" %sys.argv[1])
msg = { 'query':sys.argv[2] }

for a in sys.argv[3::]:
	k,v = a.split('=')
	msg[k] = v

print("< %s" %msg)
socket.send(json.dumps(msg))
reply = json.loads(socket.recv())
print("> %s" %niceprint(reply))
context.destroy()

@@ -177,16 +177,19 @@
 ge: %25s %3C
+ip:
 control_
@@ -347,18 +347,8 @@
 p://
-127.0.0.1:
 %25s%22 

Extend control.py to accept IP to manage