stv3_status tweaks

More efficient calls. Proper outut.

Change-Id: I2511e60cf084db48b88874f43764ce20b8f361c9
This commit is contained in:
Sandy Walsh
2015-01-23 11:14:01 -08:00
parent 46bdb0f2e5
commit a28a545e47

View File

@@ -72,16 +72,19 @@ lines = config.get('tail_lines', '100')
queue_prefixes = config.get('queue_prefixes', ['monitor']) queue_prefixes = config.get('queue_prefixes', ['monitor'])
for worker in worker_hostnames: for worker in worker_hostnames:
commands = ["ps aux | grep -E 'yagi-event|pipeline_worker'"]
for cell in cell_names: for cell in cell_names:
print "--- Worker: %s Cell: %s" % (worker, cell) commands.append("tail --lines %s /var/log/stv3/yagi-%s.log" %
ret = ssh(worker, (lines, cell))
["tail --lines %s /var/log/stv3/yagi-%s.log" %
(lines, cell), print "--- worker: %s" % (worker, )
"ps aux | grep -E 'yagi-event|pipeline_worker'"], ret = ssh(worker, commands, username, password, port)
username, password, port)
with open("yagi-%s.log" % cell, "w") as o: print ret[0]
o.write(ret[0]) for i, cell in enumerate(cell_names):
print ret[1] print "Writing %s-yagi-%s.log" % (worker, cell)
with open("%s-yagi-%s.log" % (worker, cell), "w") as o:
o.write(ret[i+1])
prefixes = '|'.join(queue_prefixes) prefixes = '|'.join(queue_prefixes)
for rabbit in rabbit_hostnames: for rabbit in rabbit_hostnames: