Use external ceph cmd for ceph df

This commit is contained in:
Joshua Boniface 2020-12-26 14:04:21 -05:00
parent d22a5aa7f2
commit a24724d9f0
1 changed files with 2 additions and 2 deletions

View File

@ -1105,9 +1105,9 @@ def collect_ceph_stats(queue):
logger.out("Set pool information in zookeeper (primary only)", state='d', prefix='ceph-thread') logger.out("Set pool information in zookeeper (primary only)", state='d', prefix='ceph-thread')
# Get pool info # Get pool info
command = {"prefix": "df", "format": "json"} retcode, stdout, stderr = common.run_os_command('ceph df --format json', timeout=1)
try: try:
ceph_pool_df_raw = json.loads(ceph_conn.mon_command(json.dumps(command), b'', timeout=1)[1])['pools'] ceph_pool_df_raw = json.loads(stdout)['pools']
except Exception as e: except Exception as e:
logger.out('Failed to obtain Pool data (ceph df): {}'.format(e), state='w') logger.out('Failed to obtain Pool data (ceph df): {}'.format(e), state='w')
ceph_pool_df_raw = [] ceph_pool_df_raw = []