Skip to content

Instantly share code, notes, and snippets.

@noonedeadpunk
Created November 13, 2019 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noonedeadpunk/d01ba61fa2b914b4963e916caed440aa to your computer and use it in GitHub Desktop.
Save noonedeadpunk/d01ba61fa2b914b4963e916caed440aa to your computer and use it in GitHub Desktop.
Get ceph filestore osds in csv: osdid,node,data path,journal path
for osd in `ceph osd tree | grep osd | awk '{ print $4 }' | cut -d '.' -f 2`; do ceph osd metadata $osd -f json | python -c "exec(\"import json\nimport sys\ndata = json.loads([ line for line in sys.stdin if line.strip()][0])\nif data['osd_objectstore'] == 'filestore':\n print(','.join([str(data['id']), data['hostname'], data['backend_filestore_partition_path'], data['backend_filestore_journal_partition_path'] if 'backend_filestore_journal_partition_path' in data else '']))\")"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment