Hi,

Same use case... We do:

/usr/bin/ceph --admin-daemon /var/run/ceph/ceph-mon.*.asok mon_status |
/usr/bin/json_reformat | /bin/grep state | /bin/grep -q leader && ...

Cheers, Dan
On May 13, 2015 09:35, "Kai Storbeck" <k...@xs4all.net> wrote:

> Hello fellow Ceph admins,
>
> I have a need to run some periodic scripts against my Ceph cluster.
> For example creating new snapshots or cleaning up old ones. I'd
> preferably want to configure this periodic artifact on all my
> monitors, but only execute it on the leader.
>
> I've come up with the following oneliner:
>
> ceph --admin-daemon /var/run/ceph/ceph-mon.*.asok mon_status | perl
> -MJSON -0e 'exit((from_json(<>))->{state} != "leader")'
>
>
> Has someone written up a quicker shortcut, preferably usable in bash?
> Or did someone solve this entirely different?
>
>
>
> Thanks in advance!
>
> Regards,
> Kai Storbeck
>
>
> _______________________________________________
> ceph-users mailing list
> ceph-users@lists.ceph.com
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
>
>
_______________________________________________
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to