码迷,mamicode.com
首页 > 其他好文 > 详细

显示列表中的xenserver的总内存,可用内存,可用内存比【易读版】

时间:2016-11-07 08:28:00      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:显示列表中的xenserver的总内存   可用内存   可用内存比   

9==显示列表中的xenserver的总内存,可用内存,可用内存比【易读版】-----------------------
for I in $(
cat <<eof | cat
PTtile
192.168.1.xxx

192.168.1.xxx

eof

);do
{
[ "$I" = "PTtile" ] && echo -e "NameLabel:\t\tIpAddress:\t\tHostName:\t\tMemTotal:\t\tMemFree:\tMemP%:" || ssh $I "
for XX in  \`/opt/xensource/bin/xe host-list params=uuid --minimal|sed ‘s/,/ /g‘\`
do  
IpAddress=\`/opt/xensource/bin/xe host-param-get param-name=address uuid=\$XX\`
NameLabel=\`/opt/xensource/bin/xe host-param-get param-name=name-label uuid=\$XX\`
HostName=\`/opt/xensource/bin/xe host-param-get param-name=hostname uuid=\$XX\`
MemTotal=\`/opt/xensource/bin/xe host-param-get param-name=memory-total uuid=\$XX\`
MemFree=\`/opt/xensource/bin/xe host-param-get param-name=memory-free uuid=\$XX\`
MemTotalG=\$[MemTotal/1024/1024/1022]
MemFreeG=\$[MemFree/1024/1024/1022]
MemP=\$[MemFree*100/MemTotal]
echo -en \$NameLabel:\\\t\$IpAddress:\\\t\\\t\$HostName:\\\t\\\t\$MemTotalG‘G‘\\\t\\\t\$MemFreeG‘G‘\\\t\\\t\$MemP%
echo
done ;
";
}
done

10===显示列表中的xenserver的总内存,可用内存,可用内存比【数字版】
for I in $(
cat <<eof | cat
PTtile
192.168.1.xxx

192.168.1.xxx

eof

);do
{
[ "$I" = "PTtile" ] && echo -e "NameLabel:\t\tIpAddress:\t\tHostName:\t\tMemTotal:\t\tMemFree:\t\tMemP%:" || ssh $I "
for XX in  \`/opt/xensource/bin/xe host-list params=uuid --minimal|sed ‘s/,/ /g‘\`
do  
IpAddress=\`/opt/xensource/bin/xe host-param-get param-name=address uuid=\$XX\`
NameLabel=\`/opt/xensource/bin/xe host-param-get param-name=name-label uuid=\$XX\`
HostName=\`/opt/xensource/bin/xe host-param-get param-name=hostname uuid=\$XX\`
MemTotal=\`/opt/xensource/bin/xe host-param-get param-name=memory-total uuid=\$XX\`
MemFree=\`/opt/xensource/bin/xe host-param-get param-name=memory-free uuid=\$XX\`
MemP=\$[MemFree*100/MemTotal]
echo -en \$NameLabel:\\\t\$IpAddress:\\\t\\\t\$HostName:\\\t\\\t\$MemTotal:\\\t\\\t\$MemFree:\\\t\$MemP:
echo
done ;
";
}
done
---------------------------------------------------------------------------

本文出自 “11416160” 博客,谢绝转载!

显示列表中的xenserver的总内存,可用内存,可用内存比【易读版】

标签:显示列表中的xenserver的总内存   可用内存   可用内存比   

原文地址:http://11426160.blog.51cto.com/11416160/1870032

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!