import json
def __run__(params):
try:
with open('/var/www/vacuum.json') as json_file:
data = json.load(json_file)
if data['last_vacuum'][0].split("\"")[1] == 'Failed':
return [2, "Vacuum with error"]
else:
return [0, "Vacuum OK"]
except Exception, e:
return [2, e]