Commit da005429 by feilong

init

parent f47262b2
......@@ -65,6 +65,7 @@ Push_n9e(){
Test_alive(){
r=$($redis_cli_cmd -h $ip -p $port ping 2>/dev/null) && value=0 || value=1
Json_join redis.alive $value "port=$port" $countertype
[ $value -eq 1 ] && return $value
[ "X$r" == 'XPONG' ] && value=0 || value=1
Json_join redis.auth_passwd $value "port=$port" $countertype
return $value
......
......@@ -45,4 +45,7 @@ if __name__ == "__main__":
sys.stderr.write('cannot get local ip')
sys.exit(0)
core_total = int(os.popen("cat /proc/cpuinfo | grep processor | tail -1 | cut -d' ' -f2").read().strip()) + 1
if core_total <= 8:
print(json.dumps(get_cpu_core_stat(core_total)))
else:
print('[]')
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