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
时间: 2024-11-03 21:27:02