def logic(data):
# ????????
#print data
f1 = open('/tmp/test.txt','a')
f1.write(data)
f1.write('\n')
f1.close()
data = json.loads(data)
print type(data)
mounts = data["MOUNT"]
netifaces = data["NET"]
for netif in netifaces:
if netif["status"] == "up":
ip = netif["ip"]
#print netifaces['ip']
for mount in mounts:
Mount_point= mount['path']
use_rate=mount['used_rate']
if use_rate > '70':
send_mail(recvmail_conf['addr'],"mount point"+Mount_point ,used_rate)
return("OK")
评论列表
文章目录