#!/bin/bash

NANNY_SERVICE=production_saas_zookeeper_new
INSTANCE_COUNT=5

sky listinstances "f@$NANNY_SERVICE" | sort -rnk3 -t '-' | head -n $INSTANCE_COUNT | cut -d '@' -f 1 | sed -e 's/:/ /' | while IFS= read -r hostport; do echo $hostport; echo mntr | nc $hostport | grep zk_server_state; done
