openStack ceilometer API
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:<type> | Gauge | instance | inst ID | both | Duration of instance <type> |
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 |
network.outgoing.bytes | Cumulative | B | iface ID | pollster | number of outgoing bytes on the network |
network.incoming.packets | Cumulative | packet | iface ID | pollster | number of incoming packets for a VM |
network.outgoing.packets | Cumulative | packet | iface ID | pollster | number of outgoing packets for a VM |
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 |

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
开源云杂谈
DBaaS是目前云计算服务的重要部分,数据库作为一种特殊的应用程序,在应用中普遍存在。而其独特性不仅在于普遍性,而且其性能对应用的表现是至关重要 的。数据库的通用性和重要性使得维护一个健壮的数据库实例变得极为复杂和繁琐,DBaaS服务旨在解决让用户能够在云中轻松设置、操作和扩展关系数据库。 在承担耗时的数据库管理任务的同时,又可提供经济高效的可调容量,使您能够腾出时间专注于应用程序和业务。 通过AWS的数据库服务可以快速了解云服务中的DBaaS的轮廓。 Amazon Web Services提供了多种不同数据库服务,如RDS(关系型数据库服务),DynamoDB(键值数据库),Redshift(数据仓库服务)等。其中RDS作为目前数据库主流得到最广泛的关注。 Amazon RDS Amazon RDS的目标用户是需要关系数据库的完整功能的开发人员或企业,或是希望对使用关系数据库的现有应用程序和工具进行迁移的用户。它能够使客户访问自己的 Amazon RDS数据库实例上运行的 MySQL、Oracle 或 SQL Server 数据库引擎的功能。 Amazon RDS的特点是使用简单,...
- 下一篇
Openstack Ceilometer监控项扩展
Openstack ceilometer主要用于监控虚拟机、服务(glance、image、network等)和事件。虚拟机的监控项主要包括CPU、磁盘、网络、instance。本文在现有监控项的基础上,介绍如何增加新的监控项目。 一、Ceilometer框架结构 Ceilometer监控通过在计算节点部署Compute服务,轮询其计算节点上的instance,获取各自的CPU、网络、磁盘等监控信息,发送到RabbitMQ,Collector服务负责接收信息进行持久化存储,详细框架如下图所示(点击查看大图)。 本文主要介绍instance的监控,获取instance的监控数据发送到message队列。instance的监控数据的获取主要通过Compute服务以pollster方式轮询各虚拟机,Compute服务类图如下(点击查看大图)。 通过该类图可知,新增项目需要继承ComputePollster类,并实现get_samples方法。最后通过配置即可,获取到新的监控项数据。由于,现有的Ceilometer没有对内存的实时监控,本文以内存为例,详细介绍增加新的监控项的流程。 二、新...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- Docker使用Oracle官方镜像安装(12C,18C,19C)
- CentOS关闭SELinux安全模块
- CentOS7安装Docker,走上虚拟化容器引擎之路
- Docker安装Oracle12C,快速搭建Oracle学习环境
- CentOS6,7,8上安装Nginx,支持https2.0的开启
- Linux系统CentOS6、CentOS7手动修改IP地址
- Hadoop3单机部署,实现最简伪集群
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- CentOS7,8上快速安装Gitea,搭建Git服务器