def interpret_output_df(output):

    try:
        data = json.loads(output)
    except Exception:
        return (1, 'CEPH WARNING: unable to parse ceph df %s' %
                traceback.format_exc())

    warn_percent = int(sys.argv[1]) if len(sys.argv) >= 2 else 85
    crit_percent = int(sys.argv[2]) if len(sys.argv) >= 3 else 98

    total = int(data['stats']['total_space'])
    used = int(data['stats']['total_used'])
    avail = int(data['stats']['total_avail'])

    # Test correctness of values
    if used + avail != total:
        return (1, '[WARN] Used + Avail. != Total space')
    elif avail < per(crit_percent, total):
        return (2, "[ERR] Ceph df avail. critical %s" % remaning(avail, total))
    elif avail < per(warn_percent, total):
        return (1, "[WARN] Ceph df avail. waring %s" % remaning(avail, total))
    else:
        return (0, "[OK] Ceph df avail. seems good %s" %
                remaning(avail, total))
Parse the output of ceph health.
dataset/ETHPy150Open openstack/monitoring-for-openstack/oschecks/ceph.py/interpret_output_df