Displays the total memory of the XenServer in the list, the available memory, the available memory than the "readable version"

Source: Internet
Author: User

9== displays the total memory of the XenServer in the list, the available memory, the available memory than the "readable version"-----------------------
For I in $ (
Cat <<eof | Cat
Pttile
192.168.1.xxx

192.168.1.xxx

Eof

);d O
{
["$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=== displays the total memory of the XenServer in the list, the available memory, the available memory than the "digital version"
For I in $ (
Cat <<eof | Cat
Pttile
192.168.1.xxx

192.168.1.xxx

Eof

);d O
{
["$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
---------------------------------------------------------------------------

This article from "11416160" blog, declined reprint!

Displays the total memory of the XenServer in the list, the available memory, the available memory than the "readable version"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.