Skip to content

Commit

Permalink
Merge pull request #27 from umesecke/master
Browse files Browse the repository at this point in the history
support changed statistic keys in json of ceph 0.84+ (fixes #25)
  • Loading branch information
rochaporto committed Feb 13, 2015
2 parents 4936e2e + 85a7968 commit eae93e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions plugins/ceph_pool_plugin.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ def get_stats(self):

# push totals from df
data[ceph_cluster]['cluster'] = {}
data[ceph_cluster]['cluster']['total_space'] = int(json_df_data['stats']['total_space']) * 1024.0
data[ceph_cluster]['cluster']['total_used'] = int(json_df_data['stats']['total_used']) * 1024.0
data[ceph_cluster]['cluster']['total_avail'] = int(json_df_data['stats']['total_avail']) * 1024.0
if json_df_data['stats'].has_key('total_bytes'):
# ceph 0.84+
data[ceph_cluster]['cluster']['total_space'] = int(json_df_data['stats']['total_bytes'])
data[ceph_cluster]['cluster']['total_used'] = int(json_df_data['stats']['total_used_bytes'])
data[ceph_cluster]['cluster']['total_avail'] = int(json_df_data['stats']['total_avail_bytes'])
else:
# ceph < 0.84
data[ceph_cluster]['cluster']['total_space'] = int(json_df_data['stats']['total_space']) * 1024.0
data[ceph_cluster]['cluster']['total_used'] = int(json_df_data['stats']['total_used']) * 1024.0
data[ceph_cluster]['cluster']['total_avail'] = int(json_df_data['stats']['total_avail']) * 1024.0

return data

Expand Down

0 comments on commit eae93e6

Please sign in to comment.