Skip to content

Commit d77e8c1

Browse files
Merge pull request jenningsloy318#54 from fschlich/master
Add SKU to chassis_model_info
2 parents 63ff508 + 4063a28 commit d77e8c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

collector/chassis_collector.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
var (
1717
ChassisSubsystem = "chassis"
1818
ChassisLabelNames = []string{"resource", "chassis_id"}
19-
ChassisModel = []string{"resource", "chassis_id", "manufacturer", "model", "part_number"}
19+
ChassisModel = []string{"resource", "chassis_id", "manufacturer", "model", "part_number", "sku"}
2020
ChassisTemperatureLabelNames = []string{"resource", "chassis_id", "sensor", "sensor_id"}
2121
ChassisFanLabelNames = []string{"resource", "chassis_id", "fan", "fan_id", "fan_unit"}
2222
ChassisPowerVoltageLabelNames = []string{"resource", "chassis_id", "power_voltage", "power_voltage_id"}
@@ -45,7 +45,7 @@ var (
4545
"chassis_model_info": {
4646
desc: prometheus.NewDesc(
4747
prometheus.BuildFQName(namespace, ChassisSubsystem, "model_info"),
48-
"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",
48+
"organization responsible for producing the chassis, the name by which the manufacturer generally refers to the chassis, and a part number and sku assigned by the organization that is responsible for producing or manufacturing the chassis",
4949
ChassisModel,
5050
nil,
5151
),
@@ -355,7 +355,8 @@ func (c *ChassisCollector) Collect(ch chan<- prometheus.Metric) {
355355
chassisManufacturer := chassis.Manufacturer
356356
chassisModel := chassis.Model
357357
chassisPartNumber := chassis.PartNumber
358-
ChassisModelLabelValues := []string{"chassis", chassisID, chassisManufacturer, chassisModel, chassisPartNumber}
358+
chassisSKU := chassis.SKU
359+
ChassisModelLabelValues := []string{"chassis", chassisID, chassisManufacturer, chassisModel, chassisPartNumber, chassisSKU}
359360
ch <- prometheus.MustNewConstMetric(c.metrics["chassis_model_info"].desc, prometheus.GaugeValue, 1, ChassisModelLabelValues...)
360361

361362
chassisThermal, err := chassis.Thermal()

0 commit comments

Comments
 (0)