Fix num_remapped_pgs field in ceph plugin (#5167)

This commit is contained in:
Maciej Mencner 2018-12-19 15:51:24 -08:00 committed by Daniel Nelson
parent 9bf2ef28f5
commit e85e6bd3e7
2 changed files with 15 additions and 15 deletions

View File

@ -328,7 +328,7 @@ type CephStatus struct {
NumInOSDs float64 `json:"num_in_osds"` NumInOSDs float64 `json:"num_in_osds"`
Full bool `json:"full"` Full bool `json:"full"`
NearFull bool `json:"nearfull"` NearFull bool `json:"nearfull"`
NumRemappedPGs float64 `json:"num_rempapped_pgs"` NumRemappedPGs float64 `json:"num_remapped_pgs"`
} `json:"osdmap"` } `json:"osdmap"`
} `json:"osdmap"` } `json:"osdmap"`
PGMap struct { PGMap struct {
@ -379,7 +379,7 @@ func decodeStatusOsdmap(acc telegraf.Accumulator, data *CephStatus) error {
"num_in_osds": data.OSDMap.OSDMap.NumInOSDs, "num_in_osds": data.OSDMap.OSDMap.NumInOSDs,
"full": data.OSDMap.OSDMap.Full, "full": data.OSDMap.OSDMap.Full,
"nearfull": data.OSDMap.OSDMap.NearFull, "nearfull": data.OSDMap.OSDMap.NearFull,
"num_rempapped_pgs": data.OSDMap.OSDMap.NumRemappedPGs, "num_remapped_pgs": data.OSDMap.OSDMap.NumRemappedPGs,
} }
acc.AddFields("ceph_osdmap", fields, map[string]string{}) acc.AddFields("ceph_osdmap", fields, map[string]string{})
return nil return nil

View File

@ -857,7 +857,7 @@ var cephStatusResults = []expectedResult{
"num_in_osds": float64(24), "num_in_osds": float64(24),
"full": false, "full": false,
"nearfull": false, "nearfull": false,
"num_rempapped_pgs": float64(0), "num_remapped_pgs": float64(0),
}, },
tags: map[string]string{}, tags: map[string]string{},
}, },