@@ -14,6 +14,7 @@ import (
14
14
var (
15
15
ChassisSubsystem = "chassis"
16
16
ChassisLabelNames = []string {"resource" , "chassis_id" }
17
+ ChassisModel = []string {"resource" , "chassis_id" , "manufacturer" , "model" , "part_number" }
17
18
ChassisTemperatureLabelNames = []string {"resource" , "chassis_id" , "sensor" , "sensor_id" }
18
19
ChassisFanLabelNames = []string {"resource" , "chassis_id" , "fan" , "fan_id" }
19
20
ChassisPowerVoltageLabelNames = []string {"resource" , "chassis_id" , "power_voltage" , "power_voltage_id" }
39
40
nil ,
40
41
),
41
42
},
43
+ "chassis_model_info" : {
44
+ desc : prometheus .NewDesc (
45
+ prometheus .BuildFQName (namespace , ChassisSubsystem , "model_info" ),
46
+ "organization responsible for producing the chassis, the name by which the manufacturer generally refers to the chassis, and a part number assigned by the organization that is responsible for producing or manufacturing the chassis" ,
47
+ ChassisModel ,
48
+ nil ,
49
+ ),
50
+ },
42
51
"chassis_temperature_sensor_state" : {
43
52
desc : prometheus .NewDesc (
44
53
prometheus .BuildFQName (namespace , ChassisSubsystem , "temperature_sensor_state" ),
@@ -245,6 +254,12 @@ func (c *ChassisCollector) Collect(ch chan<- prometheus.Metric) {
245
254
ch <- prometheus .MustNewConstMetric (c .metrics ["chassis_state" ].desc , prometheus .GaugeValue , chassisStatusStateValue , ChassisLabelValues ... )
246
255
}
247
256
257
+ chassisManufacturer := chassis .Manufacturer
258
+ chassisModel := chassis .Model
259
+ chassisPartNumber := chassis .PartNumber
260
+ ChassisModelLabelValues := []string {"chassis" , chassisID , chassisManufacturer , chassisModel , chassisPartNumber }
261
+ ch <- prometheus .MustNewConstMetric (c .metrics ["chassis_model_info" ].desc , prometheus .GaugeValue , 1 , ChassisModelLabelValues ... )
262
+
248
263
chassisThermal , err := chassis .Thermal ()
249
264
if err != nil {
250
265
chassisLogContext .WithField ("operation" , "chassis.Thermal()" ).WithError (err ).Error ("error getting thermal data from chassis" )
0 commit comments