I'm working on an update to alt's notification.py to send out a warning email if the delegate being monitored is on a fork with a participation of less than 85%. While that delegate may not be in trouble (yet) it means trouble is brewing and they need to check things out.
I'll post the code here shortly if anyone wants to patch it in to their version.
Something to get you started:
def query_participation() :
global participation
headers = {'content-type': 'application/json'}
auth = (config["bts_rpc"]["username"], config["bts_rpc"]["password"])
url = config["bts_rpc"]["url"]
info = {
"method": "info",
"params": [],
"jsonrpc": "2.0",
"id": 1
}
try:
info_res = requests.post(url, data=json.dumps(info), headers=headers, auth=auth)
info_json = json.loads(vars(info_res)["_content"])
participation = info_json["result"]["blockchain_average_delegate_participation"]
except:
print "Can't connect to rpc server"
return None
if participation < 85 :
print "Smells like fork."
else :
print ("Sitting pretty at %s%%." % participation)