Fix num_remapped_pgs field in ceph plugin (#5167)
This commit is contained in:
parent
9bf2ef28f5
commit
e85e6bd3e7
|
@ -328,7 +328,7 @@ type CephStatus struct {
|
|||
NumInOSDs float64 `json:"num_in_osds"`
|
||||
Full bool `json:"full"`
|
||||
NearFull bool `json:"nearfull"`
|
||||
NumRemappedPGs float64 `json:"num_rempapped_pgs"`
|
||||
NumRemappedPGs float64 `json:"num_remapped_pgs"`
|
||||
} `json:"osdmap"`
|
||||
} `json:"osdmap"`
|
||||
PGMap struct {
|
||||
|
@ -373,13 +373,13 @@ func decodeStatus(acc telegraf.Accumulator, input string) error {
|
|||
// decodeStatusOsdmap decodes the OSD map portion of the output of 'ceph -s'
|
||||
func decodeStatusOsdmap(acc telegraf.Accumulator, data *CephStatus) error {
|
||||
fields := map[string]interface{}{
|
||||
"epoch": data.OSDMap.OSDMap.Epoch,
|
||||
"num_osds": data.OSDMap.OSDMap.NumOSDs,
|
||||
"num_up_osds": data.OSDMap.OSDMap.NumUpOSDs,
|
||||
"num_in_osds": data.OSDMap.OSDMap.NumInOSDs,
|
||||
"full": data.OSDMap.OSDMap.Full,
|
||||
"nearfull": data.OSDMap.OSDMap.NearFull,
|
||||
"num_rempapped_pgs": data.OSDMap.OSDMap.NumRemappedPGs,
|
||||
"epoch": data.OSDMap.OSDMap.Epoch,
|
||||
"num_osds": data.OSDMap.OSDMap.NumOSDs,
|
||||
"num_up_osds": data.OSDMap.OSDMap.NumUpOSDs,
|
||||
"num_in_osds": data.OSDMap.OSDMap.NumInOSDs,
|
||||
"full": data.OSDMap.OSDMap.Full,
|
||||
"nearfull": data.OSDMap.OSDMap.NearFull,
|
||||
"num_remapped_pgs": data.OSDMap.OSDMap.NumRemappedPGs,
|
||||
}
|
||||
acc.AddFields("ceph_osdmap", fields, map[string]string{})
|
||||
return nil
|
||||
|
|
|
@ -851,13 +851,13 @@ var cephStatusResults = []expectedResult{
|
|||
{
|
||||
metric: "ceph_osdmap",
|
||||
fields: map[string]interface{}{
|
||||
"epoch": float64(21734),
|
||||
"num_osds": float64(24),
|
||||
"num_up_osds": float64(24),
|
||||
"num_in_osds": float64(24),
|
||||
"full": false,
|
||||
"nearfull": false,
|
||||
"num_rempapped_pgs": float64(0),
|
||||
"epoch": float64(21734),
|
||||
"num_osds": float64(24),
|
||||
"num_up_osds": float64(24),
|
||||
"num_in_osds": float64(24),
|
||||
"full": false,
|
||||
"nearfull": false,
|
||||
"num_remapped_pgs": float64(0),
|
||||
},
|
||||
tags: map[string]string{},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue