@@ -2,7 +2,7 @@ package collector
2
2
3
3
import (
4
4
"fmt"
5
- "math"
5
+ "math"
6
6
"strings"
7
7
"sync"
8
8
@@ -285,7 +285,7 @@ var (
285
285
}
286
286
)
287
287
288
- //ChassisCollector implements the prometheus.Collector.
288
+ // ChassisCollector implements the prometheus.Collector.
289
289
type ChassisCollector struct {
290
290
redfishClient * gofish.APIClient
291
291
metrics map [string ]chassisMetric
@@ -490,16 +490,16 @@ func parseChassisFan(ch chan<- prometheus.Metric, chassisID string, chassisFan r
490
490
491
491
chassisFanPercentage := chassisFanRPM
492
492
if chassisFanUnit != redfish .PercentReadingUnits {
493
- // Some vendors (e.g. PowerEdge C6420) report null RPMs for Min/Max, as well as Lower/UpperFatal,
494
- // but provide Lower/UpperCritical, so use largest non-null for max. However, we can't know if
495
- // min is null (reported as zero by gofish) or just zero, so we'll have to assume a min of zero
496
- // if Min is not reported...
497
- min := chassisFanRPMMin
498
- max := math .Max (math .Max (chassisFanRPMMax , chassisFanRPMUpperFatalThreshold ), chassisFanRPMUpperCriticalThreshold )
499
- chassisFanPercentage = 0
500
- if max != 0 {
501
- chassisFanPercentage = float64 ((chassisFanRPM + min )/ max ) * 100
502
- }
493
+ // Some vendors (e.g. PowerEdge C6420) report null RPMs for Min/Max, as well as Lower/UpperFatal,
494
+ // but provide Lower/UpperCritical, so use largest non-null for max. However, we can't know if
495
+ // min is null (reported as zero by gofish) or just zero, so we'll have to assume a min of zero
496
+ // if Min is not reported...
497
+ min := chassisFanRPMMin
498
+ max := math .Max (math .Max (chassisFanRPMMax , chassisFanRPMUpperFatalThreshold ), chassisFanRPMUpperCriticalThreshold )
499
+ chassisFanPercentage = 0
500
+ if max != 0 {
501
+ chassisFanPercentage = float64 ((chassisFanRPM + min )/ max ) * 100
502
+ }
503
503
}
504
504
505
505
// chassisFanStatusLabelNames :=[]string{BaseLabelNames,"fan_name","fan_member_id")
0 commit comments