|
|
@ -196,17 +196,18 @@ func (c *megaCliCollector) updateDisks() error {
|
|
|
|
|
|
|
|
|
|
|
|
for enc, encStats := range stats {
|
|
|
|
for enc, encStats := range stats {
|
|
|
|
for slot, slotStats := range encStats {
|
|
|
|
for slot, slotStats := range encStats {
|
|
|
|
|
|
|
|
encStr := strconv.Itoa(enc)
|
|
|
|
|
|
|
|
slotStr := strconv.Itoa(slot)
|
|
|
|
|
|
|
|
|
|
|
|
tStr := slotStats["Drive Temperature"]
|
|
|
|
tStr := slotStats["Drive Temperature"]
|
|
|
|
|
|
|
|
if strings.Index(tStr, "C") > 0 {
|
|
|
|
tStr = tStr[:strings.Index(tStr, "C")]
|
|
|
|
tStr = tStr[:strings.Index(tStr, "C")]
|
|
|
|
t, err := strconv.ParseFloat(tStr, 64)
|
|
|
|
t, err := strconv.ParseFloat(tStr, 64)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
encStr := strconv.Itoa(enc)
|
|
|
|
|
|
|
|
slotStr := strconv.Itoa(slot)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c.driveTemperature.WithLabelValues(encStr, slotStr).Set(t)
|
|
|
|
c.driveTemperature.WithLabelValues(encStr, slotStr).Set(t)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, i := range counters {
|
|
|
|
for _, i := range counters {
|
|
|
|
counter, err := strconv.ParseFloat(slotStats[i], 64)
|
|
|
|
counter, err := strconv.ParseFloat(slotStats[i], 64)
|
|
|
|