On Fri, Aug 28, 2015 at 1:42 PM, Wido den Hollander <wido@xxxxxxxx> wrote: > > > On 28-08-15 13:07, Gregory Farnum wrote: >> On Mon, Aug 24, 2015 at 4:03 PM, Vickey Singh >> <vickey.singh22693@xxxxxxxxx> wrote: >>> Hello Ceph Geeks >>> >>> I am planning to develop a python plugin that pulls out cluster recovery IO >>> and client IO operation metrics , that can be further used with collectd. >>> >>> For example , i need to take out these values >>> >>> recovery io 814 MB/s, 101 objects/s >>> client io 85475 kB/s rd, 1430 kB/s wr, 32 op/s >>> >>> >>> Could you please help me in understanding how ceph -s and ceph -w outputs >>> prints cluster recovery IO and client IO information. >>> Where this information is coming from. Is it coming from perf dump ? If yes >>> then which section of perf dump output is should focus on. If not then how >>> can i get this values. >>> >>> I tried ceph --admin-daemon /var/run/ceph/ceph-osd.48.asok perf dump , but >>> it generates hell lot of information and i am confused which section of >>> output should i use. >> >> This information is generated only on the monitors based on pg stats >> from the OSDs, is slightly laggy, and can be most easily accessed by >> calling "ceph -s" on a regular basis. You can get it with json output >> that is easier to parse, and you can optionally set up an API server >> for more programmatic access. I'm not sure on the details of doing >> that last, though. > > Isn't there a direct Python way to get these stats using a RADOS command? > > Executing a subprocess in Python seems kind of hacky while 'ceph' itself > is also written in Python. For examples of how you can call into admin socket commands and mon commands, see here: https://github.com/ceph/calamari/blob/master/salt/srv/salt/_modules/ceph.py Importing from ceph_argparse isn't an official API, but you could probably ask people nicely not to break it :-) If someone felt like it, it would be nice to take the service discovery and command utils from that salt module and put them in a nice python module in ceph. John 1. https://github.com/ceph/Diamond/blob/calamari/src/collectors/ceph/ceph.py _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com