Commit 179ca705 authored by litaolemo's avatar litaolemo

update

parent 2ebe3710
......@@ -53,7 +53,7 @@ def get_cluster_stats(ip):
fs_available = res_json["nodes"]["fs"].get("available_in_bytes")
fs_total = res_json["nodes"]["fs"].get("total_in_bytes")
fs_free_rate = round(1 - fs_available / fs_total,4)
return stats, timestamp, memory_used_rate, fs_free_rate
return ip, stats, timestamp, memory_used_rate, fs_free_rate
def get_index_stats(ip,index):
......@@ -97,11 +97,11 @@ def get_node_status(ip):
def parse_cluster_stats(data):
res_str = ""
stats, timestamp, memory_used_rate, fs_free_rate = data
ip, stats, timestamp, memory_used_rate, fs_free_rate = data
if memory_used_rate >= memory_used_rate_top:
res_str += "集群内存使用率超过%s 目前为%s\n" % (str(round(memory_used_rate_top*100,2))+'%',str(round(memory_used_rate * 100,2))+'%')
res_str += "%s集群内存使用率超过%s 目前为%s\n" % (ip, str(round(memory_used_rate_top*100,2))+'%',str(round(memory_used_rate * 100,2))+'%')
if fs_free_rate >= fs_free_rate_top:
res_str += "集群硬盘占用超过%s 目前为%s\n" % (str(round(fs_free_rate_top*100,2))+'%',str(round(fs_free_rate * 100,2))+'%')
res_str += "%s集群硬盘占用超过%s 目前为%s\n" % (ip, str(round(fs_free_rate_top*100,2))+'%',str(round(fs_free_rate * 100,2))+'%')
return res_str
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment