Created
November 13, 2019 17:08
-
-
Save noonedeadpunk/d01ba61fa2b914b4963e916caed440aa to your computer and use it in GitHub Desktop.
Get ceph filestore osds in csv: osdid,node,data path,journal path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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