From: Zack Cerza Date: Mon, 28 Aug 2017 21:12:58 +0000 (-0600) Subject: mon: Add 'ceph df' pool stats X-Git-Tag: v1.0~26^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a821b7942e631d71491c05461ef84b88a01f509a;p=cephmetrics.git mon: Add 'ceph df' pool stats Signed-off-by: Zack Cerza --- diff --git a/collectors/mon.py b/collectors/mon.py index 4dd2f38..d6052a8 100644 --- a/collectors/mon.py +++ b/collectors/mon.py @@ -429,6 +429,11 @@ class Mon(BaseCollector): return {metric_format[k][0]: metrics[k] for k in metrics} if metrics else {} + def _get_df_stats(self): + """ get 'ceph df' stats from rados """ + raw_stats = self._mon_command('df') + return raw_stats + def _get_pool_stats(self): """ get pool stats from rados """ @@ -589,6 +594,11 @@ class Mon(BaseCollector): # read from the admin socket was OK, so process the data cluster_state = self.get_mon_health(cluster_data) pool_stats = self._get_pool_stats() + df_stats = self._get_df_stats() + for df_obj in df_stats['pools']: + pool_name = df_obj['name'] + pool_stats[pool_name] = merge_dicts( + pool_stats[pool_name], df_obj['stats']) num_osd_hosts, osd_states = self._get_osd_states() cluster_state['num_osd_hosts'] = num_osd_hosts