8 disks = json.loads(subprocess.check_output("ceph-disk list --format json", shell=True))
12 for partition in disk.get('partition', []):
13 if partition.get('type') == 'data':
14 df = subprocess.check_output("df --output=used " + partition['path'], shell=True)
15 used += int(re.findall('\d+', df)[0])
17 facts_file = os.environ.get("CEPH_FACTS_FILE", "/etc/rhsm/facts/ceph_usage.facts")
18 open(facts_file, 'w').write("""\
20 "band.storage.usage": {used}
22 """.replace('{used}', str(int(used/(1024*1024*1024)))))