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"