1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/bin/sh # Produce per-machine reports to be handed out on slips of paper. set -e SERVICE="$1" juju status 2>/dev/null | \ egrep "$SERVICE/|public-address" | \ sed '$!N;s/\n/ /;s/://;s/\//-/' | \ awk '{print $1 " " $3}' | \ while read unit host; do if [ "$unit" = "public-address" ]; then continue fi echo "Unit: $unit" ssh ubuntu@$host sudo /var/lib/juju/units/$unit/charm/hooks/report $host </dev/null 2>/dev/null echo "" done |