与Ceph监控对接说明文档
一、 概述
通过将Ceph采集功能集成到Falcon的agent组件中,达到agent部署的所在节点完成对Ceph的监控信息的采集并上报Falcon的目的,利用Falcon的绘图和告警特点完成对Ceph的使用情况的资源监控和趋势判断。
二、 功能原理
Ceph有一个ceph-rest-api的http服务,提供ceph相关的获取信息,可以通过restAPI来获取Ceph的相关信息,也可以直接通过命令行的方式获取Ceph相关信息(由于该方式没有rsetAPI高效,暂时未采用),在Falcon的agent组件中增添Ceph采集模块,在模块中完成对Ceph的OSD、Monitor、Mds、Pg、存储等信息的采集,并上报到Falcon。
三、 配置说明
需要在agent组件的配置文件cfg.json配置文件中配置ceph字段,形式如下:
"ceph": {
"enabled": true,
"url": "http://127.0.0.1:5000/api/v0.1"
},
该配置项中enabled项表示是否打开ceph监控采集信息,url项表示通过该url来调用restAPI获取Ceph相关信息。
四、 监控项
1. Ceph的OSD监控相关信息
restAPIurl:/api/v0.1/osd/stat
命令行:ceph osd stat --format=json
监控项具体如下:
ceph.osd.num_remapped_pgs
ceph.osd.num_out_osds
ceph.osd.num_in_osds
ceph.osd.epoch
ceph.osd.num_down_osds
ceph.osd.num_up_osds
ceph.osd.num_osds
ceph.osd.nearfull
ceph.osd.full
ceph.osd.status
restAPIurl:/api/v0.1/osd/df
命令行:ceph osd df
监控项具体如下:
ceph.osd.id //ceph osd 的id
ceph.osd.weight
ceph.osd.reweight
ceph.osd.bytes.used //ceph osd 已使用量
ceph.osd.bytes.avail //ceph osd 剩余可用量
ceph.osd.bytes.total //ceph osd 空间总量
ceph.osd.used.percent //ceph osd 已使用量占比
ceph.osd.var
ceph.osd.pgs //ceph osd pgs个数
ceph.osd.bytes.total.used //ceph osd 总已使用量
ceph.osd.bytes.total.avail //ceph osd 总剩余可用量
ceph.osd.bytes.total.all //ceph osd 总和空间总量
ceph.osd.totalused.percent // ceph osd 已使用量总和占比
上报效果图:
2. Ceph的存储容量监控相关信息
restAPIurl:/api/v0.1/df
命令行:ceph df
监控项具体如下:
ceph.pool.name //ceph池的名字
ceph.pool.id //ceph池的id
ceph.pool.bytes.used //ceph池已使用量
ceph.pool.bytes.maxavail //ceph池剩余可用量
ceph.pool.num.objects //ceph池对象个数
ceph.pool.used.percent //ceph池已使用量占比
ceph.global.bytes.used //ceph集群空间已使用量
ceph.global.bytes.avail //ceph集群空间剩余量
ceph.global.bytes.total //ceph集群空间总量
ceph.global.used.percent //ceph集群空间已使用量占比
上报效果截图:
3. Ceph的Monitor相关监控信息
restAPIurl:/api/v0.1/ mon_status
命令行:ceph mon_status
监控项具体如下:
ceph.mon.node.name
ceph.mon.node.addr
ceph.mon.node.rank
ceph.mon.node.status
ceph.mon.rank
上报效果截图:
4. Ceph的Mds相关监控信息
restAPIurl:/api/v0.1/mds/dump.json
命令行:ceph mds dump --format=json
监控项具体有如下:
ceph.mds.max_mds
ceph.mds.metadata_pool
ceph.mds.max_file_size
ceph.mds.explicitly_allowed_features
ceph.mds.last_failure
ceph.mds.last_failure_osd_epoch
ceph.mds.session_autoclose
ceph.mds.metadata_pool
ceph.mds.epoch
ceph.mds.flags
ceph.mds.in.num
ceph.mds.up.num
ceph.mds.stopped.num
ceph.mds.data_pools.num
ceph.mds.failed.num
ceph.mds.damaged.num
上报效果截图:
5. Ceph的Pgs相关监控信息
restAPIurl:/api/v0.1/pg/stat
命令行:ceph pg stat --format=json
监控项具体如下:
ceph.pgs.bytes.used //ceph pgs已使用量
ceph.pgs.bytes.data //ceph pgs 数据量
ceph.pgs.bytes.avail //ceph pgs 剩余可用量
ceph.pgs.bytes.total //ceph pgs 总空间量
ceph.pgs.free.percent //ceph pgs 剩余可用占比
ceph.pgs.activeclean.num // ceph pgsactive+clean 个数
ceph.pgs.num //ceph pgs 个数
ceph.pgs.status //ceph pgs 状态
上报效果截图:
6. Ceph的状态相关监控信息
restAPIurl:/api/v0.1/health
命令行:ceph health(该命令获取不到详细信息,API可以获取到)
监控项具体如下:
ceph.node.mons_name
ceph.node.mons_health
ceph.node.mons_latency
ceph.node.mons_skew
ceph.node.name
ceph.node.health
ceph.node.bytes.kb_used
ceph.node.bytes.kb_total
ceph.node.bytes.kb_avail
ceph.node.bytes.avail_percent
ceph.node.bytes.bytes_log
ceph.node.bytes.bytes_misc
ceph.node.bytes.bytes_sst
ceph.node.bytes.bytes_total
ceph.node.overall_status
ceph.node.status
ceph.node.round
ceph.node.epoch
上报效果截图: