设为首页 收藏本站
查看: 1841|回复: 0

[经验分享] openStack ceilometer API

[复制链接]

尚未签到

发表于 2015-4-11 16:51:56 | 显示全部楼层 |阅读模式
1.概述

Ceilometer是OpenStack中的一个子项目,它像一个漏斗一样,能把OpenStack内部发生的几乎所有的事件都收集起来,然后为计费和监控以及其它服务提供数据支撑。Ceilometer的核心架构图如下:




图1 Ceilometer的核心架构图


图2 Ceilometer架构模型

2.安装

2.1安装服务

apt-get install ceilometer-api
ceilometer-collector ceilometer-agent-central python-ceilometerclient

2.2配置

/etc/ceilometer/ceilometer.conf


[DEFAULT]

#rabbitMQ

rabbit_host = client

rabbit_password = 12345

rabbit_hosts = client:5672

rabbit_userid = guest


[database]

connection = mysql://ceilometer:12345@client/ceilometer


[publisher_rpc]

metering_secret = ADMIN


[keystone_authtoken]

auth_host = client

auth_port = 35357

auth_protocol = http

admin_tenant_name = service

admin_user = ceilometer

admin_password = ceilometers


2.3在keystone中创建ceilometer用户和服务endpoint

keystone user-create –name=ceilometer
–pass=CEILOMETER_PASS –email=ceilometer@example.com

keystone user-role-add –user=ceilometer
–tenant=service –role=admin

keystone service-create –name=ceilometer
–type=metering –description=”Ceilometer Telemetry Service”

keystone endpoint-create
–service-id=the_service_id_above
–publicurl=http://controller:8777/
–internalurl=http://controller:8777/
–adminurl=http://controller:8777/

2.4创建ceilometer的mysql数据表

ceilometer-dbsync

2.5重启服务

service ceilometer-agent-central restart

service ceilometer-api restart

service ceilometer-collector restart

3.API

3.1 Resources资源

获取资源的信息。


GET          http://HOST:8777/v2/resources

列出所有资源的定义。

GET          http://HOST:8777/v2/resources/{resource_id}

获取指定的资源的详细信息。

3.2 Meters计量

获取计量信息。


GET          http://HOST:8777/v2/meters

到目前为止的计量数据列表。


GET          http://HOST:8777/v2/meters/{meter_id}

获取指定ID的计量信息。


POST        http://HOST:8777/v2/meters/{meter_id}

更新指定ID的计量信息列表。


GET          http://HOST:8777/v2/meters/{meter_id}/statistics

计算在指定的时间范围内的样本的统计信息。

3.3 Alarms告警

列表,创建,获取详细信息,更新和删除报警。


GET          http://HOST:8777/v2/alarms

根据指定查询,列出了警报。


POST        http://HOST:8777/v2/alarms

创建一个报警。


GET          http://HOST:8777/v2/alarms/{alarm_id}

获取指定ID的报警信息。


PUT          http://HOST:8777/v2/alarms/{alarm_id}

更新指定ID的报警。


PUT          http://HOST:8777/v2/alarms/{alarm_id}/state

设置一个指定ID的报警状态。


GET          http://HOST:8777/v2/alarms/{alarm_id}/state

获取指定ID的报警状态。


GET          http://HOST:8777/v2/alarms/{alarm_id}/history

组装指定ID的报警历史记录。


4.OpenStack服务的监控

4.1Compute (Nova)

所有计量来自实例,不宿主机.


名称

类型

单位

资源

Origin

说明

instance

Gauge

instance

inst ID

both

Duration of instance

instance:

Gauge

instance

inst ID

both

Duration of instance
(openstack types)

memory

Gauge

MB

inst ID

notification

Volume of RAM in MB

cpu

Cumulative

ns

inst ID

pollster

CPU time used

cpu_util

Gauge

%

inst ID

pollster

Average CPU utilisation

vcpus

Gauge

vcpu

inst ID

notification

Number of VCPUs

disk.read.requests

Cumulative

request

inst ID

pollster

Number of read requests

disk.write.requests

Cumulative

request

inst ID

pollster

Number of write requests

disk.read.bytes

Cumulative

B

inst ID

pollster

Volume of read in B

disk.write.bytes

Cumulative

B

inst ID

pollster

Volume of write in B

disk.root.size

Gauge

GB

inst ID

notification

Size of root disk in GB

disk.ephemeral.size

Gauge

GB

inst ID

notification

Size of ephemeral disk in GB

network.incoming.bytes

Cumulative

B

iface ID

pollster

number of incoming bytes on the network
for a VM interface

network.outgoing.bytes

Cumulative

B

iface ID

pollster

number of outgoing bytes on the network
for a VM interface

network.incoming.packets

Cumulative

packet

iface ID

pollster

number of incoming packets for a VM
interface

network.outgoing.packets

Cumulative

packet

iface ID

pollster

number of outgoing packets for a VM
interface

At present, most of the Nova meters will
only work with libvirt front-end hypervisors while test coverage was mostly
done based on KVM. Contributors are welcome to implement other virtualization
backends’ meters or complete the existing ones.

4.2 Network (Neutron)

名称

类型

单位

资源

Origin

说明

network

Gauge

network

netw ID

notification

Duration of network

network.create

Delta

network

netw ID

notification

Creation requests for this network

network.update

Delta

network

netw ID

notification

Update requests for this network

subnet

Gauge

subnet

subnt ID

notification

Duration of subnet

subnet.create

Delta

subnet

subnt ID

notification

Creation requests for this subnet

subnet.update

Delta

subnet

subnt ID

notification

Update requests for this subnet

port

Gauge

port

port ID

notification

Duration of port

port.create

Delta

port

port ID

notification

Creation requests for this port

port.update

Delta

port

port ID

notification

Update requests for this port

router

Gauge

router

rtr ID

notification

Duration of router

router.create

Delta

router

rtr ID

notification

Creation requests for this router

router.update

Delta

router

rtr ID

notification

Update requests for this router

ip.floating

Gauge

ip

ip ID

both

Duration of floating ip

ip.floating.create

Delta

ip

ip ID

notification

Creation requests for this floating ip

ip.floating.update

Delta

ip

ip ID

notification

Update requests for this floating ip

4.3Image (Glance)

名称

类型

单位

资源

Origin

说明

image

Gauge

image

image ID

both

Image polling -> it (still) exists

image.size

Gauge

B

image ID

both

Uploaded image size

image.update

Delta

image

image ID

notification

Number of update on the image

image.upload

Delta

image

image ID

notification

Number of upload of the image

image.delete

Delta

image

image ID

notification

Number of delete on the image

image.download

Delta

B

image ID

notification

Image is downloaded

image.serve

Delta

B

image ID

notification

Image is served out


4.4Volume (Cinder)

名称

类型

单位

资源

Origin

说明

volume

Gauge

volume

vol ID

notification

Duration of volume

volume.size

Gauge

GB

vol ID

notification

Size of volume


4.5Object Storage (Swift)

名称

类型

单位

资源

Origin

说明

storage.objects

Gauge

object

store ID

pollster

Number of objects

storage.objects.size

Gauge

B

store ID

pollster

Total size of stored objects

storage.objects.containers

Gauge

container

store ID

pollster

Number of containers

storage.objects.incoming.bytes

Delta

B

store ID

notification

Number of incoming bytes

storage.objects.outgoing.bytes

Delta

B

store ID

notification

Number of outgoing bytes

storage.api.request

Delta

request

store ID

notification

Number of API requests against swift

storage.containers.objects

Gauge

object

str ID/cont

pollster

Number of objects in container

storage.containers.objects.size

Gauge

B

str ID/cont

pollster

Total size of stored objects in container


4.6Energy (Kwapi)

名称

类型

单位

资源

Origin

说明

energy

Cumulative

kWh

probe ID

pollster

Amount of energy

power

Gauge

W

probe ID

pollster

Power consumption


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-56097-1-1.html 上篇帖子: OpenStack Keystone源码安装 下篇帖子: 记录下openstack部署和使用时遇到的一些问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表