Skip to content

Commit

Permalink
Merge base rules
Browse files Browse the repository at this point in the history
Signed-off-by: Masayuki Ishii <[email protected]>
  • Loading branch information
masa213f committed Jun 12, 2024
1 parent 4664290 commit 898ecc2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 142 deletions.
100 changes: 0 additions & 100 deletions base-rules/dell-redfish-v117.yaml

This file was deleted.

31 changes: 16 additions & 15 deletions base-rules/dell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Traverse:
- /TaskService
- /TelemetryService
- /UpdateService
- /LicenseService
# Sub-metrics included in /Power or /Thermal
- /Power/
- /Power#/
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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 \
# <model-1-data>.json <model-2-data>.json ... > generated.yaml
46 changes: 19 additions & 27 deletions base-rules/run_generate-rule.sh
Original file line number Diff line number Diff line change
@@ -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 \
$@

0 comments on commit 898ecc2

Please sign in to comment.