|
20 | 20 | ChassisPowerSupplyLabelNames = []string{"resource", "chassis_id", "power_supply", "power_supply_id"}
|
21 | 21 | ChassisNetworkAdapterLabelNames = []string{"resource", "chassis_id", "network_adapter", "network_adapter_id"}
|
22 | 22 | ChassisNetworkPortLabelNames = []string{"resource", "chassis_id", "network_adapter", "network_adapter_id", "network_port", "network_port_id", "network_port_type", "network_port_speed"}
|
23 |
| - ChassisPhysicalSecurityLabelNames = []string{"resource", "chassis_id", "intrusion_sensor_number", "intrusion_sensor"} |
| 23 | + ChassisPhysicalSecurityLabelNames = []string{"resource", "chassis_id", "intrusion_sensor_number", "intrusion_sensor_rearm"} |
24 | 24 |
|
25 | 25 | chassisMetrics = map[string]chassisMetric{
|
26 | 26 | "chassis_health": {
|
@@ -167,10 +167,10 @@ var (
|
167 | 167 | nil,
|
168 | 168 | ),
|
169 | 169 | },
|
170 |
| - "chassis_physical_security_sensor_rearm_method": { |
| 170 | + "chassis_physical_security_sensor_state": { |
171 | 171 | desc: prometheus.NewDesc(
|
172 |
| - prometheus.BuildFQName(namespace, ChassisSubsystem, "physical_security_sensor_rearm_method"), |
173 |
| - "method that restores this physical security sensor to the normal state, 1()", |
| 172 | + prometheus.BuildFQName(namespace, ChassisSubsystem, "physical_security_sensor_state"), |
| 173 | + "indicates the known state of the physical security sensor, such as if it is hardware intrusion detected, 1(Normal),2(TamperingDetected),3(HardwareIntrusion)", |
174 | 174 | ChassisPhysicalSecurityLabelNames,
|
175 | 175 | nil,
|
176 | 176 | ),
|
@@ -323,12 +323,14 @@ func (c *ChassisCollector) Collect(ch chan<- prometheus.Metric) {
|
323 | 323 |
|
324 | 324 | physicalSecurity := chassis.PhysicalSecurity
|
325 | 325 | if physicalSecurity != (redfish.PhysicalSecurity{}) {
|
326 |
| - physicalSecurityIntrusionSensor := fmt.Sprintf("%s", physicalSecurity.IntrusionSensor) |
| 326 | + physicalSecurityIntrusionSensor := physicalSecurity.IntrusionSensor |
327 | 327 | physicalSecurityIntrusionSensorNumber := fmt.Sprintf("%d", physicalSecurity.IntrusionSensorNumber)
|
328 |
| - physicalSecurityIntrusionSensorReArmMethod := physicalSecurity.IntrusionSensorReArm |
329 |
| - if phySecReArmMethod, ok := parsePhySecReArmMethod(physicalSecurityIntrusionSensorReArmMethod); ok { |
330 |
| - ChassisPhysicalSecurityLabelValues := []string{"physical_security", chassisID, physicalSecurityIntrusionSensorNumber, physicalSecurityIntrusionSensor} |
331 |
| - ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_physical_security_sensor_rearm_method"].desc, prometheus.GaugeValue, phySecReArmMethod, ChassisPhysicalSecurityLabelValues...) |
| 328 | + physicalSecurityIntrusionSensorReArmMethod := string(physicalSecurity.IntrusionSensorReArm) |
| 329 | + |
| 330 | + if phySecIntrusionSensor, ok := parsePhySecIntrusionSensor(physicalSecurityIntrusionSensor); ok { |
| 331 | + ChassisPhysicalSecurityLabelValues := []string{"physical_security", chassisID, physicalSecurityIntrusionSensorNumber, physicalSecurityIntrusionSensorReArmMethod} |
| 332 | + ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_physical_security_sensor_state"].desc, prometheus.GaugeValue, phySecIntrusionSensor, ChassisPhysicalSecurityLabelValues...) |
| 333 | + |
332 | 334 | }
|
333 | 335 | }
|
334 | 336 | chassisLogContext.Info("collector scrape completed")
|
|
0 commit comments