Ceph: 使用 Ceph Admin API 进行监控

Ceph 已经有一段时间提供了 admin API。本文档演示并提供了一些使用 Ceph 进行监控的提示。
检查健康状态
bash $ curl localhost:5000/api/v0.1/health HEALTH_OK
OSD 树
```bash $ curl localhost:5000/api/v0.1/osd/tree
id weight type name up/down reweight
-1 2 root default -4 2 datacenter dc -5 2 room laroom -6 2 row larow -3 2 rack lerack -2 2 host ceph 0 1 osd.0 up 1 1 1 osd.1 up 1 ```
OSD 状态
```bash $ curl localhost:5000/api/v0.1/osd/stat
osdmap e1371: 2 osds: 2 up, 2 in
```
监控器状态
```bash $ curl localhost:5000/api/v0.1/mon/stat e3: 1 mons at {1=192.168.251.100:6790/0}, election epoch 1, quorum 0 1
$ curl localhost:5000/api/v0.1/mon_status {"name":"1","rank":0,"state":"leader","election_epoch":1,"quorum":[0],"outside_quorum":[],"extra_probe_peers":[],"sync_provider":[],"monmap":{"epoch":3,"fsid":"1c13637d-6c6f-47e3-92ca-3687f9cf9b52","modified":"2013-03-15 16:47:55.482545","created":"2013-03-11 10:33:18.021677","mons":[{"rank":0,"name":"1","addr":"192.168.251.100:6790\/0"}]}} ```
有关完整的 API 概述,请参阅: http://dmsimard.com/2014/01/01/documentation-for-ceph-rest-api/