diff --git a/ansible/roles/stv3-workers/templates/yagi.conf.j2 b/ansible/roles/stv3-workers/templates/yagi.conf.j2 index 9dddce3..b0a3e6b 100644 --- a/ansible/roles/stv3-workers/templates/yagi.conf.j2 +++ b/ansible/roles/stv3-workers/templates/yagi.conf.j2 @@ -23,7 +23,7 @@ default_level = {{ yagi_log_level }} #config_file = /etc/stv3/logging.conf [consumers] -queues = monitor.info +queues = monitor.info,monitor.error [consumer:monitor.info] #apps = yagi.handler.shoebox_handler.ShoeboxHandler @@ -34,6 +34,14 @@ routing_key = monitor.info durable = True max_messages = 100 +[consumer:monitor.error] +apps = winchester.yagi_handler.WinchesterHandler +exchange = monitor +exchange_type = topic +routing_key = monitor.error +durable = True +max_messages = 100 + [filters] cufpub = compute.instance.exists.verified,compute.instance.exists diff --git a/bin/stv3_status.py b/bin/stv3_status.py index a011079..a51e7ee 100644 --- a/bin/stv3_status.py +++ b/bin/stv3_status.py @@ -66,6 +66,7 @@ username = config.get('username') password = config.get('password') worker_hostnames = config['worker_hostnames'] rabbit_hostnames = config['rabbit_hostnames'] +api_hostnames = config['api_hostnames'] port = int(config.get('ssh_port', 22)) vhost = config.get('vhost', '/') lines = config.get('tail_lines', '100') @@ -86,6 +87,19 @@ for worker in worker_hostnames: with open("%s-yagi-%s.log" % (worker, cell), "w") as o: o.write(ret[i+1]) +for api in api_hostnames: + commands = ["ps aux | grep -E 'gunicorn'", + "tail --lines %s /var/log/stv3/gunicorn.log" % (lines, )) + ] + + print "--- api: %s" % (api, ) + ret = ssh(worker, commands, username, password, port) + + print ret[0] + print "Writing %s-gunicorn.log" % (worker,) + with open("%s-gunicorn.log" % (worker,), "w") as o: + o.write(ret[1]) + prefixes = '|'.join(queue_prefixes) for rabbit in rabbit_hostnames: print "--- RabbitMQ: %s vhost: %s" % (rabbit, vhost)