Re: ceph admin socket protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 10, 2016 at 09:32:33PM +0200, Stefan Priebe - Profihost AG wrote:
> 
> Am 10.07.2016 um 16:33 schrieb Daniel Swarbrick:
> > If you can read C code, there is a collectd plugin that talks directly
> > to the admin socket:
> > 
> > https://github.com/collectd/collectd/blob/master/src/ceph.c
> 
> thanks can read that.

If you're interested in using the AdminSocketClient here's some example code.

#include "common/admin_socket_client.h"

#include <string>

int main(int argc, char** argv)
{
    std::string response;
    AdminSocketClient client(argv[1]);
    //client.do_request("{\"prefix\":\"help\"}", &response);
    //client.do_request("{\"prefix\":\"help\", \"format\": \"json\"}", &response);
    client.do_request("{\"prefix\":\"perf dump\"}", &response);
    //client.do_request("{\"prefix\":\"perf dump\", \"format\": \"json\"}", &response);
    std::cout << response << '\n';

    return 0;

}

// $ g++ -O2 -std=c++11 ceph-admin-socket-test.cpp -I../ceph/src/ -I../ceph/build/include/ ../ceph/build/lib/libcommon.a


-- 
Cheers,
Brad

> 
> Stefan
> 
> > 
> > On 10/07/16 10:36, Stefan Priebe - Profihost AG wrote:
> >> Hi,
> >>
> >> is the ceph admin socket protocol described anywhere? I want to talk
> >> directly to the socket instead of calling the ceph binary. I searched
> >> the doc but didn't find anything useful.
> >>
> >> Thanks,
> >> Stefan
> >>
> > 
> > 
> > _______________________________________________
> > ceph-users mailing list
> > ceph-users@xxxxxxxxxxxxxx
> > http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
> _______________________________________________
> ceph-users mailing list
> ceph-users@xxxxxxxxxxxxxx
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux