Skip to content

Instantly share code, notes, and snippets.

View hansbogert's full-sized avatar

Hans van den Bogert hansbogert

View GitHub Profile
@hansbogert
hansbogert / ceph-health.py
Last active October 2, 2017 11:38 — forked from wido/ceph-health.py
Ceph Health in Python in a loop
#!/usr/bin/env python
import time
import rados
import json
def get_cluster_health(r):
cmd = {"prefix":"status", "format":"json"}
ret, buf, errs = r.mon_command(json.dumps(cmd), b'', timeout=5)
result = json.loads(buf)