首页 > 代码库 > xenserver 统计CPU 利用率 utilisation
xenserver 统计CPU 利用率 utilisation
for I in $(
cat <<eof | cat
PTtile
192.168.1.xx pool只填写一个主机ip就好
192.168.1.xx
eof
);do
{
[ "$I" = "PTtile" ] && echo -e "HostName:\t\tCPU_NUMBER:\tUTILISATION:" || ssh $I "
#xe host-list params=name-label --minimal
for XX in \`/opt/xensource/bin/xe host-cpu-list --minimal|sed ‘s/,/ /g‘\`
do
CPU_NUMBER=\`/opt/xensource/bin/xe host-cpu-param-get param-name=utilisation uuid=\$XX\`
UTILISATION=\`/opt/xensource/bin/xe host-cpu-param-get param-name=number uuid=\$XX\`
YY=\`/opt/xensource/bin/xe host-cpu-param-get param-name=host-uuid uuid=\$XX\`
HostName=\`/opt/xensource/bin/xe host-list params=name-label --minimal uuid=\$YY\`
echo -en \$HostName\\\t\$UTILISATION\\\t\\\t\$CPU_NUMBER
echo
done ;
";
}
done
本文出自 “11416160” 博客,转载请与作者联系!
xenserver 统计CPU 利用率 utilisation