KeyError: 'total_space' in oschecks-check_ceph_df on CEPH 1.3 (OSP7)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Operators |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi everyone,
I just ran into this:
[root@ceph03-prv ~]# /usr/bin/
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/lib/
exit_code, message = interpret_
File "/usr/lib/
total = int(data[
KeyError: 'total_space'
But ceph is fine:
[root@ceph03-prv ~]# ceph df
GLOBAL:
SIZE AVAIL RAW USED %RAW USED
27916G 25566G 2350G 8.42
POOLS:
NAME ID USED %USED MAX AVAIL OBJECTS
rbd 0 0 0 8335G 0
images 1 164G 0.59 8335G 21162
volumes 2 328G 1.18 8335G 52705
vms 3 291G 1.05 8335G 40132
Here's the reason:
oschecks-
total_space, total_used, total_avail
But when I look at the output from 'ceph df --format=json' , I get these instead:
[root@ceph03-prv ~]# ceph df --format=json|sed -e 's/:/ /g'|xargs -n1|grep tota
{total_bytes
29974933831680,
2523633577984,
Here's the diff that fixes it for me: python2. 7/site- packages/ oschecks/ ceph.py. orig /usr/lib/ python2. 7/site- packages/ oschecks/ ceph.py python2. 7/site- packages/ oschecks/ ceph.py. orig 2016-01-22 18:04:12.575117528 -0500 python2. 7/site- packages/ oschecks/ ceph.py 2016-01-22 18:05:13.449092454 -0500
[root@ceph03-prv ~]# diff -c /usr/lib/
*** /usr/lib/
--- /usr/lib/
***************
*** 49,57 ****
warn_percent = int(sys.argv[1]) if len(sys.argv) >= 2 else 85
crit_percent = int(sys.argv[2]) if len(sys.argv) >= 3 else 98
! total = int(data[ 'stats' ]['total_ space'] ) 'stats' ]['total_ used']) 'stats' ]['total_ avail'] )
! used = int(data[
! avail = int(data[
# Test correctness of values
if used + avail != total:
--- 49,57 ----
warn_percent = int(sys.argv[1]) if len(sys.argv) >= 2 else 85
crit_percent = int(sys.argv[2]) if len(sys.argv) >= 3 else 98
! total = int(data[ 'stats' ]['total_ bytes'] ) 'stats' ]['total_ used_bytes' ]) 'stats' ]['total_ avail_bytes' ])
! used = int(data[
! avail = int(data[
# Test correctness of values
if used + avail != total: