import json
import sys
from pprint import pprint
pprint(json.load(sys.stdin))
aW1wb3J0IGpzb24KaW1wb3J0IHN5cwpmcm9tIHBwcmludCBpbXBvcnQgcHByaW50CgpwcHJpbnQoanNvbi5sb2FkKHN5cy5zdGRpbikp
eyZxdW90O2Rlc2NyaXB0aW9uJnF1b3Q7OiZxdW90O1NjcmlwdCB0byBjaGVjayB0ZXN0dGJlYXQgb2YgVEVTVCAxIHNlcnZlci4mcXVvdDssICZxdW90O3NjcmlwdCZxdW90OzomcXVvdDsjIS9iaW4vYmFzaFxuc2V0IC1lXG5cbkNPVU5UPTYwICAgI251bWJlciBvZiAxMCBzZWNvbmQgdGltZW91dHMgaW4gMTAgbWludXRlc1xuU1VNX1NZTkNTPTBcblNVTV9TWU5DU19CRUhJTkQ9MFxuSE9TVE5BTUU9JGhvc3RuYW1lICAgICAgI2RjMWRieDExNDUuZGMxLmhvc3QuY29tXG5cbndoaWxlIFtbICRDT1VOVCAtZ2UgXCZxdW90OzBcJnF1b3Q7IF1dOyBkb1xuXG5lY2hvICRIT1NUTkFNRVxuXG4jc2VuZCB0aGUgcmVxdWVzdCwgcHV0IHJlc3BvbnNlIGluIHZhcmlhYmxlXG5EQVRBPSQod2dldCAtTyAtIC1xIC10IDEgaHR0cDovLyRIT1NUTkFNRTo4MDgwL2hlYXJ0YmVhdClcblxuI2dyZXAgJERBVEEgZm9yIHN5bmNzIGFuZCBzeW5jc19iZWhpbmRcblNZTkNTPSQoZWNobyAkREFUQSB8IGdyZXAgLW9FICdudW1fc3luY3M6IFswLTldKycgfCBhd2sgJ3twcmludCAkMn0nKVxuU1lOQ1NfQkVISU5EPSQoZWNobyAkREFUQSB8IGdyZXAgLW9FICdudW1fc3luY3NfYmVoaW5kOiBbMC05XSsnIHwgYXdrICd7cHJpbnQgJDJ9JylcblxuZWNobyAkU1lOQ1NcbmVjaG8gJFNZTkNTX0JFSElORFxuXG4jdmVyaWZ5IGNvbmRpdGlvbmFsc1xuaWYgW1sgJFNZTkNTIC1ndCBcJnF1b3Q7OFwmcXVvdDsgJmFtcDsmYW1wOyAkU1lOQ1NfQkVISU5EIC1lcSBcJnF1b3Q7MFwmcXVvdDsgXV07IHRoZW4gZXhpdCAwOyBmaVxuXG4jZGVjcmVtZW50IHRoZSBjb3VudGVyXG5sZXQgQ09VTlQtPTFcblxuI3dhaXQgYW5vdGhlciAxMCBzZWNvbmRzXG5zbGVlcCAxMFxuXG5kb25lXG4mcXVvdDt9Cg==
{"description":"Script to check testtbeat of TEST 1 server.", "script":"#!/bin/bash\nset -e\n\nCOUNT=60 #number of 10 second timeouts in 10 minutes\nSUM_SYNCS=0\nSUM_SYNCS_BEHIND=0\nHOSTNAME=$hostname #dc1dbx1145.dc1.host.com\n\nwhile [[ $COUNT -ge \"0\" ]]; do\n\necho $HOSTNAME\n\n#send the request, put response in variable\nDATA=$(wget -O - -q -t 1 http://$HOSTNAME:8080/heartbeat)\n\n#grep $DATA for syncs and syncs_behind\nSYNCS=$(echo $DATA | grep -oE 'num_syncs: [0-9]+' | awk '{print $2}')\nSYNCS_BEHIND=$(echo $DATA | grep -oE 'num_syncs_behind: [0-9]+' | awk '{print $2}')\n\necho $SYNCS\necho $SYNCS_BEHIND\n\n#verify conditionals\nif [[ $SYNCS -gt \"8\" && $SYNCS_BEHIND -eq \"0\" ]]; then exit 0; fi\n\n#decrement the counter\nlet COUNT-=1\n\n#wait another 10 seconds\nsleep 10\n\ndone\n"}