From 1cc4e63b71aa35ccbe32975cdef48dba28f2f3f4 Mon Sep 17 00:00:00 2001 From: Maho Takara Date: Mon, 20 Jan 2025 08:53:17 +0900 Subject: [PATCH] Update rule from Redfish v1.20.1 (#126) * generate rule from v1.20.1 * add how to memo * update for review comment * deleted the double quoation --- base-rules/dell.yaml | 4 + docs/how_to_install_collector.md | 56 ++++ redfish/rendered_rules.go | 404 ++++++++++++++------------ redfish/rules/dell_redfish_1.20.1.yml | 37 ++- 4 files changed, 312 insertions(+), 189 deletions(-) create mode 100644 docs/how_to_install_collector.md diff --git a/base-rules/dell.yaml b/base-rules/dell.yaml index 2a75000..8883d94 100644 --- a/base-rules/dell.yaml +++ b/base-rules/dell.yaml @@ -70,6 +70,10 @@ Metrics: ## Fabrics - Path: /redfish/v1/Fabrics/{fabric} - Path: /redfish/v1/Fabrics/{fabric}/Switches + - Path: /redfish/v1/Fabrics/{fabric}/Switches/{switch} + - Path: /redfish/v1/Fabrics/{fabric}/Switches/{switch}/Ports + - Path: /redfish/v1/Fabrics/{fabric}/Switches/{switch}/Ports/{switchport} + ## Managers - Path: /redfish/v1/Managers/{manager} - Path: /redfish/v1/Managers/{manager}/Attributes diff --git a/docs/how_to_install_collector.md b/docs/how_to_install_collector.md new file mode 100644 index 0000000..b182ec4 --- /dev/null +++ b/docs/how_to_install_collector.md @@ -0,0 +1,56 @@ +How to install collector command +===================================== + +The collector command can run in a setup-hw container or on a bare metal Linux server. +This memo describes how to install the command on a bare metal server. + +## 1.Clone code from github repository + +``` +$ git clone https://github.com/cybozu-go/setup-hw +``` + +## 2.Build & install collector command + +``` +$ cd setup-hw +$ make install +``` + +## 3.Setup config + +Put a bmc-user.json file in /etc/neco/ that must have "support" user to use the collector command. + +``` +{ + "support": { + "password": { + "raw": "raw password here" + } + } +} +``` + +Put a bmc-address.json file in /etc/neco. + +``` +{ + "ipv4": { + "address": "192.0.2.3", + "netmask": "255.255.255.0", + "gateway": "192.0.2.1" + } +} +``` + +please see [config.md](config.md) file. + +## 4.Check + +By following the above steps, you can execute the collector command. + +``` +$ collector show +``` + +Next, see [how to generate rules](how_to_generate_rules.md). diff --git a/redfish/rendered_rules.go b/redfish/rendered_rules.go index 42a9e18..574abe1 100644 --- a/redfish/rendered_rules.go +++ b/redfish/rendered_rules.go @@ -2606,6 +2606,191 @@ var Rules = map[string]*CollectRule{ }, }, }, + "dell_redfish_1.2.0.yml": { + TraverseRule: TraverseRule{ + Root: "/redfish/v1", + ExcludeRules: []string{ + "/JSONSchemas", + "/Accounts", + "/Certificates", + "/Jobs", + "/Logs", + "/Registries", + "/Roles", + "/Sessions", + "/AccountService", + "/EventService", + "/LogServices", + "/SessionService", + "/TaskService", + "/UpdateService", + "/Power/", + "/Sensors/", + "/Thermal/", + "/redfish/v1/Chassis/$", + }, + }, + MetricRules: []*MetricRule{ + { + Path: "/redfish/v1/Chassis/{chassis}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "chassis_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Chassis/{chassis}/Power", + PropertyRules: []*PropertyRule{ + { + Pointer: "/PowerSupplies/{psu}/Status/Health", + Name: "chassis_psu_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Redundancy/{set}/Status/Health", + Name: "chassis_psu_redundancy_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Voltages/{sensor}/Status/Health", + Name: "chassis_voltage_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Chassis/{chassis}/Thermal", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Fans/{fan}/Status/Health", + Name: "chassis_fan_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Redundancy/{set}/Status/Health", + Name: "chassis_fan_redundancy_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Temperatures/{sensor}/Status/Health", + Name: "chassis_temperature_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Temperatures/{sensor}/ReadingCelsius", + Name: "chassis_temperature_reading", + Help: "", + Type: "number", + }, + }, + }, + { + Path: "/redfish/v1/Managers/{manager}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "manager_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Managers/{manager}/EthernetInterfaces/{interface}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "manager_network_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Systems/{system}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "system_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/MemorySummary/Status/Health", + Name: "system_memory_summary_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/ProcessorSummary/Status/Health", + Name: "system_processor_summary_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/TrustedModules/{tpm}/Status/State", + Name: "system_tpm_status_state", + Help: "", + Type: "state", + }, + }, + }, + { + Path: "/redfish/v1/Systems/{system}/EthernetInterfaces/{interface}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "network_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Systems/{system}/Processors/{processor}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "processor_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Systems/{system}/Storage/Drives/{device}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "storage_device_status_health", + Help: "", + Type: "health", + }, + }, + }, + { + Path: "/redfish/v1/Systems/{system}/Storage/{controller}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "storage_controller_status_health", + Help: "", + Type: "health", + }, + }, + }, + }, + }, "dell_redfish_1.20.1.yml": { TraverseRule: TraverseRule{ Root: "/redfish/v1", @@ -3110,6 +3295,40 @@ var Rules = map[string]*CollectRule{ }, }, }, + { + Path: "/redfish/v1/Fabrics/{fabric}/Switches/{switch}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "fabrics_switches_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Status/State", + Name: "fabrics_switches_status_state", + Help: "", + Type: "state", + }, + }, + }, + { + Path: "/redfish/v1/Fabrics/{fabric}/Switches/{switch}/Ports/{switchport}", + PropertyRules: []*PropertyRule{ + { + Pointer: "/Status/Health", + Name: "fabrics_switches_ports_status_health", + Help: "", + Type: "health", + }, + { + Pointer: "/Status/State", + Name: "fabrics_switches_ports_status_state", + Help: "", + Type: "state", + }, + }, + }, { Path: "/redfish/v1/Managers/{manager}", PropertyRules: []*PropertyRule{ @@ -3481,191 +3700,6 @@ var Rules = map[string]*CollectRule{ }, }, }, - "dell_redfish_1.2.0.yml": { - TraverseRule: TraverseRule{ - Root: "/redfish/v1", - ExcludeRules: []string{ - "/JSONSchemas", - "/Accounts", - "/Certificates", - "/Jobs", - "/Logs", - "/Registries", - "/Roles", - "/Sessions", - "/AccountService", - "/EventService", - "/LogServices", - "/SessionService", - "/TaskService", - "/UpdateService", - "/Power/", - "/Sensors/", - "/Thermal/", - "/redfish/v1/Chassis/$", - }, - }, - MetricRules: []*MetricRule{ - { - Path: "/redfish/v1/Chassis/{chassis}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "chassis_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Chassis/{chassis}/Power", - PropertyRules: []*PropertyRule{ - { - Pointer: "/PowerSupplies/{psu}/Status/Health", - Name: "chassis_psu_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/Redundancy/{set}/Status/Health", - Name: "chassis_psu_redundancy_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/Voltages/{sensor}/Status/Health", - Name: "chassis_voltage_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Chassis/{chassis}/Thermal", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Fans/{fan}/Status/Health", - Name: "chassis_fan_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/Redundancy/{set}/Status/Health", - Name: "chassis_fan_redundancy_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/Temperatures/{sensor}/Status/Health", - Name: "chassis_temperature_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/Temperatures/{sensor}/ReadingCelsius", - Name: "chassis_temperature_reading", - Help: "", - Type: "number", - }, - }, - }, - { - Path: "/redfish/v1/Managers/{manager}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "manager_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Managers/{manager}/EthernetInterfaces/{interface}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "manager_network_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Systems/{system}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "system_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/MemorySummary/Status/Health", - Name: "system_memory_summary_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/ProcessorSummary/Status/Health", - Name: "system_processor_summary_status_health", - Help: "", - Type: "health", - }, - { - Pointer: "/TrustedModules/{tpm}/Status/State", - Name: "system_tpm_status_state", - Help: "", - Type: "state", - }, - }, - }, - { - Path: "/redfish/v1/Systems/{system}/EthernetInterfaces/{interface}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "network_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Systems/{system}/Processors/{processor}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "processor_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Systems/{system}/Storage/Drives/{device}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "storage_device_status_health", - Help: "", - Type: "health", - }, - }, - }, - { - Path: "/redfish/v1/Systems/{system}/Storage/{controller}", - PropertyRules: []*PropertyRule{ - { - Pointer: "/Status/Health", - Name: "storage_controller_status_health", - Help: "", - Type: "health", - }, - }, - }, - }, - }, "dell_redfish_1.4.0.yml": { TraverseRule: TraverseRule{ Root: "/redfish/v1", diff --git a/redfish/rules/dell_redfish_1.20.1.yml b/redfish/rules/dell_redfish_1.20.1.yml index 88ec3f1..faa38c6 100644 --- a/redfish/rules/dell_redfish_1.20.1.yml +++ b/redfish/rules/dell_redfish_1.20.1.yml @@ -22,7 +22,7 @@ Traverse: - /Power/ - /Power#/ - /Thermal#/ - - /Assembly#/ + - /Assembly#/ - /redfish/v1/Chassis/$ Metrics: @@ -95,6 +95,7 @@ Metrics: Pointer: /Slots/{slot}/Status/State Type: state +# Inherited properties from v1.18.0 earlier - Path: /redfish/v1/Chassis/{chassis}/Power Properties: - Name: chassis_power_powercontrol_powerconsumedwatts @@ -102,7 +103,7 @@ Metrics: Type: number - Name: chassis_power_powersupplies_redundancy_status_health Pointer: /PowerSupplies/{powersupply}/Redundancy/{redundancy}/Status/Health - Type: health + Type: health - Name: chassis_power_powersupplies_redundancy_status_state Pointer: /PowerSupplies/{powersupply}/Redundancy/{redundancy}/Status/State Type: state @@ -128,7 +129,7 @@ Metrics: - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem Properties: - Name: chassis_powersubsystem_powersupplyredundancy_status_health - Pointer: /PowerSupplyRedundancy/{powersupplyredundancy}/Status/Health + Pointer: /PowerSupplyRedundancy/{powersupplyredundancy}/Status/Health Type: health - Name: chassis_powersubsystem_powersupplyredundancy_status_state Pointer: /PowerSupplyRedundancy/{powersupplyredundancy}/Status/State @@ -149,6 +150,7 @@ Metrics: Pointer: /Status/State Type: state +## Inherited properties from v1.18.0 or earlier - Path: /redfish/v1/Chassis/{chassis}/PowerSubsystem/PowerSupplies/{unit}/Metrics Properties: - Name: chassis_powersubsystem_powersupplies_metrics_frequencyhz_reading @@ -163,7 +165,7 @@ Metrics: - Name: chassis_powersubsystem_powersupplies_metrics_inputvoltage_reading Pointer: /InputVoltage/Reading Type: number - - Name: chassis_powersubsystem_powersupplies_metrics_outputpowerwatts_readin + - Name: chassis_powersubsystem_powersupplies_metrics_outputpowerwatts_reading Pointer: /OutputPowerWatts/Reading Type: number - Name: chassis_powersubsystem_powersupplies_metrics_status_health @@ -173,6 +175,7 @@ Metrics: Pointer: /Status/State Type: state +## Inherited properties from v1.18.0 or earlier - Path: /redfish/v1/Chassis/{chassis}/Sensors/{sensor} Properties: - Name: chassis_sensors_reading @@ -197,6 +200,7 @@ Metrics: Pointer: /Thresholds/UpperCritical/Reading Type: number +## Inherited properties from v1.18.0 or earlier - Path: /redfish/v1/Chassis/{chassis}/Thermal Properties: - Name: chassis_thermal_fans_reading @@ -248,6 +252,7 @@ Metrics: Pointer: /Status/State Type: state +# Inherited properties from v1.18.0 or earlier - Path: /redfish/v1/Chassis/{chassis}/ThermalSubsystem/ThermalMetrics Properties: - Name: chassis_thermalsubsystem_thermalmetrics_temperaturereadingscelsius_reading @@ -272,6 +277,26 @@ Metrics: Pointer: /Status/State Type: state +# Since RedFish 1.20.1 +- Path: /redfish/v1/Fabrics/{fabric}/Switches/{switch} + Properties: + - Name: fabrics_switches_status_health + Pointer: /Status/Health + Type: health + - Name: fabrics_switches_status_state + Pointer: /Status/State + Type: state + +# Since RedFish 1.20.1 +- Path: /redfish/v1/Fabrics/{fabric}/Switches/{switch}/Ports/{switchport} + Properties: + - Name: fabrics_switches_ports_status_health + Pointer: /Status/Health + Type: health + - Name: fabrics_switches_ports_status_state + Pointer: /Status/State + Type: state + - Path: /redfish/v1/Managers/{manager} Properties: - Name: managers_status_health @@ -344,6 +369,7 @@ Metrics: Pointer: /Status/State Type: state +# Inherited properties from v1.18.0 earlier - Path: /redfish/v1/Systems/{system}/Memory/{memory}/MemoryMetrics Properties: - Name: systems_memory_memorymetrics_healthdata_alarmtrips_addressparityerror @@ -386,6 +412,7 @@ Metrics: Pointer: /Status/State Type: state +# Inherited properties from v1.18.0 earlier - Path: /redfish/v1/Systems/{system}/SimpleStorage/{controller} Properties: - Name: systems_simplestorage_devices_status_health @@ -401,6 +428,7 @@ Metrics: Pointer: /Status/State Type: state +# Inherited properties from v1.18.0 earlier - Path: /redfish/v1/Systems/{system}/Storage/{storage} Properties: - Name: systems_storage_status_health @@ -425,6 +453,7 @@ Metrics: Pointer: /Status/State Type: state +# Inherited properties from v1.18.0 earlier - Path: /redfish/v1/Systems/{system}/Storage/{storage}/Drives/{device} Properties: - Name: systems_storage_drives_failurepredicted