4.2.9list hosts命令

list hosts site_name

list hosts命令用于获取包含给定管理站点的主机列表。该命令需要一个参数,即要检查的站点的名称。对于列出的每个主机,返回的信息包括主机名、状态和正在使用的管理代理软件的版本,如本例所示:

mcm> list hosts mysite;
+-----------+-----------+---------+
| Host      | Status    | Version |
+-----------+-----------+---------+
| tonfisk   | Available | 1.3.6   |
+-----------+-----------+---------+
| flundra   | Available | 1.3.6   |
+-----------+-----------+---------+
2 rows in set (0.16 sec)

如果省略site_name参数,命令将失败并出现错误,如下所示:

mcm> list hosts;
ERROR 6 (00MGR): Illegal number of operands

使用--verbose选项(缩写形式 : -v)会导致命令打印有关主机的附加信息:

mcm> list hosts --verbose mysite;
+---------+-----------+---------+-------+---------+-------------------------------+
| Host    | Status    | Version | Cores | Memory  | OS                            |
+---------+-----------+---------+-------+---------+-------------------------------+
| tonfisk | Available |  1.3.6  | 1     | 1819 Mb | Linux 3.13.11-100.fc19.x86_64 |
| flundra | Available |  1.3.6  | 1     | 1819 Mb | Linux 3.13.11-100.fc19.x86_64 |
+---------+-----------+---------+-------+---------+-------------------------------+
2 rows in set (0.07 sec)