From 898ecc21a98a95f9e2b3394dc2f2ce0806787570 Mon Sep 17 00:00:00 2001 From: Masayuki Ishii Date: Wed, 12 Jun 2024 11:04:18 +0900 Subject: [PATCH] Merge base rules Signed-off-by: Masayuki Ishii --- base-rules/dell-redfish-v117.yaml | 100 ------------------------------ base-rules/dell.yaml | 31 ++++----- base-rules/run_generate-rule.sh | 46 ++++++-------- 3 files changed, 35 insertions(+), 142 deletions(-) delete mode 100644 base-rules/dell-redfish-v117.yaml diff --git a/base-rules/dell-redfish-v117.yaml b/base-rules/dell-redfish-v117.yaml deleted file mode 100644 index d366cae..0000000 --- a/base-rules/dell-redfish-v117.yaml +++ /dev/null @@ -1,100 +0,0 @@ -Traverse: - Root: /redfish/v1 - Excludes: - # Schemas - - /JsonSchemas - # Non-metric properties - - /Accounts - - /Certificates - - /Jobs - - /Logs - - /Registries - - /Roles - - /Sessions - - /Settings - # Services - - /AccountService - - /CertificateService - - /EventService - - /JobService - - /LogServices - - /SessionService - - /TaskService - - /TelemetryService - - /UpdateService - - /LicenseService - # Sub-metrics included in /Power or /Thermal - - /Power/ - - /Power#/ - - /Thermal#/ - - /Assembly#/ - # Redundant page with extra trailing slash - - /redfish/v1/Chassis/$ - -Metrics: - ## Chassis - - Path: /redfish/v1/Chassis/{chassis} - - Path: /redfish/v1/Chassis/{chassis}/Assembly - - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic} - - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic}/NetworkDeviceFunctions/{function} - - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic}/NetworkPorts/{port} - - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic}/Ports/{port} - - Path: /redfish/v1/Chassis/{chassis}/PCIeDevices/{device} - - Path: /redfish/v1/Chassis/{chassis}/PCIeDevices/{device}/PCIeFunctions/{function} - - Path: /redfish/v1/Chassis/{chassis}/PCIeSlots - - Path: /redfish/v1/Chassis/{chassis}/Power - - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem - - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem/PowerSupplies/{unit} - - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem/PowerSupplies/{unit}/Metrics - - Path: /redfish/v1/Chassis/{chassis}/Sensors/{sensor} - - Path: /redfish/v1/Chassis/{chassis}/Thermal - - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem - - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem/Fans/{unit} - - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem/ThermalMetrics - - ## Dell - - Path: /redfish/v1/Dell/Chassis/{system}/DellAssembly/{assembly} - - Path: /redfish/v1/Dell/Systems/{system}/DellNumericSensor/{sensor} - - Path: /redfish/v1/Dell/Systems/{system}/DellPCIeFunction/{function} - - Path: /redfish/v1/Dell/Systems/{system}/DellPSNumericSensor/{sensor} - - Path: /redfish/v1/Dell/Systems/{system}/DellSensor/{sensor} - - Path: /redfish/v1/Dell/Systems/{system}/DellSlot/{slot} - - Path: /redfish/v1/Dell/Systems/{system}/Memory/DellMemory/{memory} - - Path: /redfish/v1/Dell/Systems/{system}/NetworkAdapters/NetworkDeviceFunctions/DellNICPortMetrics/{port} - - Path: /redfish/v1/Dell/Systems/{system}/NetworkDeviceFunctions/DellNIC/{nic} - - Path: /redfish/v1/Dell/Systems/{system}/NetworkDeviceFunctions/DellNICCapabilities/{nic} - - Path: /redfish/v1/Dell/Systems/{system}/NetworkPorts/DellSwitchConnection/{connection} - - Path: /redfish/v1/Dell/Systems/{system}/Processors/DellProcessor/{processor} - - Path: /redfish/v1/Dell/Systems/{system}/Storage/DellController/{controller} - - Path: /redfish/v1/Dell/Systems/{system}/Storage/DellPCIeSSD/{disk} - - Path: /redfish/v1/Dell/Systems/{system}/Storage/Drives/DellPhysicalDisk/{disk} - - Path: /redfish/v1/Dell/Systems/{system}/Storage/Volumes/DellVirtualDisk/{disk} - ## Fabrics - - Path: /redfish/v1/Fabrics/{fabric} - - Path: /redfish/v1/Fabrics/{fabric}/Switches - ## Managers - - Path: /redfish/v1/Managers/{manager} - - Path: /redfish/v1/Managers/{manager}/Attributes - - Path: /redfish/v1/Managers/{manager}/EthernetInterfaces/{interface} - - Path: /redfish/v1/Managers/{manager}/HostInterfaces/{host} - - Path: /redfish/v1/Managers/{manager}/NetworkProtocol - ## Systems - - Path: /redfish/v1/Systems/{system} - - Path: /redfish/v1/Systems/{system}/BootOptions/{option} - - Path: /redfish/v1/Systems/{system}/EthernetInterfaces/{interface} - - Path: /redfish/v1/Systems/{system}/Memory/{memory} - - Path: /redfish/v1/Systems/{system}/Memory/{memory}/MemoryMetrics - - Path: /redfish/v1/Systems/{system}/NetworkAdapters/{nic} - - Path: /redfish/v1/Systems/{system}/NetworkAdapters/{nic}/NetworkDeviceFunctions/{function} - - Path: /redfish/v1/Systems/{system}/NetworkAdapters/{nic}/NetworkPorts/{port} - - Path: /redfish/v1/Systems/{system}/NetworkInterfaces/{nic} - - Path: /redfish/v1/Systems/{system}/PCIeDevices/{device} - - Path: /redfish/v1/Systems/{system}/PCIeDevices/{device}/PCIeFunctions/{function} - - Path: /redfish/v1/Systems/{system}/Processors/{processor} - - Path: /redfish/v1/Systems/{system}/SimpleStorage/{controller} - - Path: /redfish/v1/Systems/{system}/Storage/{storage} - - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Controllers/{controller} - - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Drives/{device} - - Path: /redfish/v1/Systems/{system}/Storage/{storage}/StorageControllers/{controller} - - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Volumes - - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Volumes/{volume} diff --git a/base-rules/dell.yaml b/base-rules/dell.yaml index cf8b507..aa1a47e 100644 --- a/base-rules/dell.yaml +++ b/base-rules/dell.yaml @@ -22,6 +22,7 @@ Traverse: - /TaskService - /TelemetryService - /UpdateService + - /LicenseService # Sub-metrics included in /Power or /Thermal - /Power/ - /Power#/ @@ -31,15 +32,26 @@ Traverse: - /redfish/v1/Chassis/$ Metrics: + ## Chassis - Path: /redfish/v1/Chassis/{chassis} - Path: /redfish/v1/Chassis/{chassis}/Assembly - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic} - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic}/NetworkDeviceFunctions/{function} - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic}/NetworkPorts/{port} + - Path: /redfish/v1/Chassis/{chassis}/NetworkAdapters/{nic}/Ports/{port} + - Path: /redfish/v1/Chassis/{chassis}/PCIeDevices/{device} + - Path: /redfish/v1/Chassis/{chassis}/PCIeDevices/{device}/PCIeFunctions/{function} - Path: /redfish/v1/Chassis/{chassis}/PCIeSlots - Path: /redfish/v1/Chassis/{chassis}/Power + - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem + - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem/PowerSupplies/{unit} + - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem/PowerSupplies/{unit}/Metrics - Path: /redfish/v1/Chassis/{chassis}/Sensors/{sensor} - Path: /redfish/v1/Chassis/{chassis}/Thermal + - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem + - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem/Fans/{unit} + - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem/ThermalMetrics + ## Dell - Path: /redfish/v1/Dell/Chassis/{system}/DellAssembly/{assembly} - Path: /redfish/v1/Dell/Systems/{system}/DellNumericSensor/{sensor} - Path: /redfish/v1/Dell/Systems/{system}/DellPCIeFunction/{function} @@ -56,13 +68,16 @@ Metrics: - Path: /redfish/v1/Dell/Systems/{system}/Storage/DellPCIeSSD/{disk} - Path: /redfish/v1/Dell/Systems/{system}/Storage/Drives/DellPhysicalDisk/{disk} - Path: /redfish/v1/Dell/Systems/{system}/Storage/Volumes/DellVirtualDisk/{disk} + ## Fabrics - Path: /redfish/v1/Fabrics/{fabric} - Path: /redfish/v1/Fabrics/{fabric}/Switches + ## Managers - Path: /redfish/v1/Managers/{manager} - Path: /redfish/v1/Managers/{manager}/Attributes - Path: /redfish/v1/Managers/{manager}/EthernetInterfaces/{interface} - Path: /redfish/v1/Managers/{manager}/HostInterfaces/{host} - Path: /redfish/v1/Managers/{manager}/NetworkProtocol + ## Systems - Path: /redfish/v1/Systems/{system} - Path: /redfish/v1/Systems/{system}/BootOptions/{option} - Path: /redfish/v1/Systems/{system}/EthernetInterfaces/{interface} @@ -77,22 +92,8 @@ Metrics: - Path: /redfish/v1/Systems/{system}/Processors/{processor} - Path: /redfish/v1/Systems/{system}/SimpleStorage/{controller} - Path: /redfish/v1/Systems/{system}/Storage/{storage} + - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Controllers/{controller} - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Drives/{device} - Path: /redfish/v1/Systems/{system}/Storage/{storage}/StorageControllers/{controller} - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Volumes - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Volumes/{volume} - -# ./collector generate-rule --base-rule=base-rules/dell.yaml \ -# --key=Health:health \ -# --key=FailurePredicted:bool \ -# --key=PredictedMediaLifeLeftPercent:number \ -# --key=AddressParityError:bool \ -# --key=CorrectableECCError:bool \ -# --key=SpareBlock:bool \ -# --key=Temperature:bool \ -# --key=UncorrectableECCError:bool \ -# --key=DataLossDetected:bool \ -# --key=State:state \ -# --key=ReadingCelsius:number \ -# --key=PowerConsumedWatts:number \ -# .json .json ... > generated.yaml diff --git a/base-rules/run_generate-rule.sh b/base-rules/run_generate-rule.sh index ab92c85..1df3aed 100755 --- a/base-rules/run_generate-rule.sh +++ b/base-rules/run_generate-rule.sh @@ -1,33 +1,25 @@ #!/usr/bin/bash # -# Shell for collector generate-rule execute on container +# Shell for collector generate-rule execute # -# 2023/7/14 RedFish v1.17 +# Usage: run_generate-rule.sh INPUT_FILES... > OUTPUT_FILE # -# Please edit for your environment -RULE="dell-redfish-v117.yaml" # Base rule -INPUT1="r7525-data-omsa1100.json" # Output by "collector show" command -INPUT2="r6525-data-omsa1100.json" # for each PowerEdge Model -OUTPUT="dell_redfish_1.17.0.yml" # Output rule file for Promethus/Grafana -SETUP_HW="quay.io/neco_test/setup-hw:dev" # Latest container image if there is dell command upgrade. +SCRIPT_DIR="$(cd $(dirname $0); pwd)" -docker run -it --name=setup-hw \ - -v ${PWD}:/mnt \ - --rm \ - ${SETUP_HW} collector generate-rule \ - --base-rule=/mnt/${RULE} \ - --key=Health:health \ - --key=State:state \ - --key=FailurePredicted:bool \ - --key=PredictedMediaLifeLeftPercent:number \ - --key=AddressParityError:bool \ - --key=CorrectableECCError:bool \ - --key=SpareBlock:bool \ - --key=Temperature:bool \ - --key=UncorrectableECCError:bool \ - --key=DataLossDetected:bool \ - --key=ReadingCelsius:number \ - --key=PowerConsumedWatts:number \ - --key=Reading:number \ - /mnt/${INPUT1} /mnt/${INPUT2} > ${OUTPUT} +collector generate-rule \ + --base-rule=${SCRIPT_DIR}/dell.yaml \ + --key=AddressParityError:bool \ + --key=CorrectableECCError:bool \ + --key=DataLossDetected:bool \ + --key=FailurePredicted:bool \ + --key=Health:health \ + --key=PowerConsumedWatts:number \ + --key=PredictedMediaLifeLeftPercent:number \ + --key=Reading:number \ + --key=ReadingCelsius:number \ + --key=SpareBlock:bool \ + --key=State:state \ + --key=Temperature:bool \ + --key=UncorrectableECCError:bool \ + $@