ceilometer命令行使用方法(上篇)

达芬奇密码2018-08-23 10:01

ceilometer命令行常用的二级子命令有以下一些:

  • meter-list** List the user’s meters .获取监控维度列表
  • query-samples** Query samples.筛选采样样本
  • resource-list** List the resources.获取监控资源列表
  • resource-show** Show the resource.获取监控资源详情
  • sample-create** Create a sample创建采样样本
  • sample-list** List the samples (return OldSample objects if -m/–meter is set).获取采样样本列表
  • sample-show** Show an sample.显示采样样本详情
  • statistics** List the statistics for a meter.获取监控维度统计数据


ceilometer meter-list

首先创建要使用 hw_qemu_guest_agent 的镜像

hzhuangzhexiao@10-180-2-112:~$ glance image-show 06ec58df-fc10-4e25-88ac-6c6f1533de58
+--------------------------------+------------------------------------------+
| Property                       | Value                                    |
+--------------------------------+------------------------------------------+
| Property 'hw_qemu_guest_agent' | yes                                      |
| Property 'hypervisor_type'     | qemu                                     |
| Property 'os_type'             | linux                                    |
| Property 'support_inject_ip'   | yes                                      |
| checksum                       | 2bc9185deadfb28dcb881c4e0b7f9595         |
| container_format               | ovf                                      |
| created_at                     | 2016-02-03T09:31:18                      |
| deleted                        | False                                    |
| disk_format                    | qcow2                                    |
| id                             | 06ec58df-fc10-4e25-88ac-6c6f1533de58     |
| is_public                      | True                                     |
| min_disk                       | 0                                        |
| min_ram                        | 0                                        |
| name                           | debian_7_x86_64_nce_release2_22362.qcow2 |
| owner                          | 5116a55a1a91499986c20803a901f0a4         |
| protected                      | False                                    |
| size                           | 519897088                                |
| status                         | active                                   |
| updated_at                     | 2016-02-03T09:31:44                      |
+--------------------------------+------------------------------------------+

然后查到云主机的uuid

通过这个查询,这个云主机有哪些 meter。

ceilometer meter-list -q resource="aed3992e-7f9a-4fab-88e5-727c0a700a4b"

一般返回示例为

hzhuangzhexiao@10-180-2-112:~$ ceilometer meter-list -q resource="aed3992e-7f9a-4fab-88e5-727c0a700a4b"
+--------------------------------------------------------------------------------+-------+------+---------------------------------------------------------------------------------------------------------------------+----------------------------------+----------------------------------+
| Name                                                                           | Type  | Unit | Resource ID                                                                                                         | User ID                          | Project ID                       |
+--------------------------------------------------------------------------------+-------+------+---------------------------------------------------------------------------------------------------------------------+----------------------------------+----------------------------------+
| netease.cpu.rate                                                               | gauge | %    | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.cpu.rate                                                               | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda.read.delay                                                    | gauge | ms   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda.read.delay                                                    | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda.read.rate                                                     | gauge | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda.read.rate                                                     | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda.read.req                                                      | gauge | Hz   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda.read.req                                                      | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda.write.delay                                                   | gauge | ms   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda.write.delay                                                   | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda.write.rate                                                    | gauge | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda.write.rate                                                    | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda.write.req                                                     | gauge | Hz   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda.write.req                                                     | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda1.read.delay                                                   | gauge | ms   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda1.read.delay                                                   | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda1.read.rate                                                    | gauge | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda1.read.rate                                                    | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda1.read.req                                                     | gauge | Hz   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda1.read.req                                                     | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda1.write.delay                                                  | gauge | ms   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda1.write.delay                                                  | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda1.write.rate                                                   | gauge | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda1.write.rate                                                   | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vda1.write.req                                                    | gauge | Hz   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vda1.write.req                                                    | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vdb.read.delay                                                    | gauge | ms   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vdb.read.delay                                                    | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vdb.read.rate                                                     | gauge | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vdb.read.rate                                                     | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vdb.read.req                                                      | gauge | Hz   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vdb.read.req                                                      | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vdb.write.delay                                                   | gauge | ms   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vdb.write.delay                                                   | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vdb.write.rate                                                    | gauge | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vdb.write.rate                                                    | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.disk.vdb.write.req                                                     | gauge | Hz   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.disk.vdb.write.req                                                     | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.fs.vda1.$!.total                                                       | gauge | byte | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.fs.vda1.$!.total                                                       | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.fs.vda1.$!.used                                                        | gauge | byte | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.fs.vda1.$!.used                                                        | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.loadavg.avg5_rate                                                      | gauge | -    | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.loadavg.avg5_rate                                                      | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.memory.total                                                           | gauge | kB   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.memory.total                                                           | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.memory.used                                                            | gauge | kB   | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.memory.used                                                            | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.memory.used.rate                                                       | gauge | %    | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.memory.used.rate                                                       | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.recv       | delta | Byte | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.recv       | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.recv.rate  | delta | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.recv.rate  | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.trans      | delta | Byte | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.trans      | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
| netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.trans.rate | delta | Bps  | aed3992e-7f9a-4fab-88e5-727c0a700a4b.netease.nic.eth0.826f526e-6d7f-4073-9bb7-a4bf302835c5.10-180-194-55.trans.rate | 1e5607d739cc4c4fab1ba1ee9bbf1c17 | 067d4c55e93e42eca837d1c7a1a74ce8 |
+--------------------------------------------------------------------------------+-------+------+---------------------------------------------------------------------------------------------------------------------+----------------------------------+----------------------------------+
hzhuangzhexiao@10-180-2-112:~$


相关阅读:ceilometer命令行使用方法(下篇)

网易云新用户大礼包:https://www.163yun.com/gift

本文来自网易实践者社区,经作者黄哲骁授权发布。