From ca4388ce7620f229a74fed8f514a8587a3d681e2 Mon Sep 17 00:00:00 2001 From: "Evgeny Alekseev (IBS Group)" Date: Tue, 27 Sep 2022 14:28:25 +0300 Subject: IBS: Add psus thresholds yaml 4 dbus-mon --- .../recipes-phosphor/dbus/psu-threshold-policy.bb | 17 +++++ .../psu-threshold-policy/psu-threshold-policy.yaml | 88 ++++++++++++++++++++++ .../dbus/psu-thresholds-manager.bb | 17 ----- .../dbus/psu-thresholds-manager/snmp-config.yaml | 18 ----- 4 files changed, 105 insertions(+), 35 deletions(-) create mode 100644 meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy.bb create mode 100644 meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy/psu-threshold-policy.yaml delete mode 100644 meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager.bb delete mode 100644 meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager/snmp-config.yaml diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy.bb b/meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy.bb new file mode 100644 index 0000000000..b1d55553b6 --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy.bb @@ -0,0 +1,17 @@ +SUMMARY = "snmp policy configuration for meta-ibm machines" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit allarch +inherit phosphor-dbus-monitor + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://psu-threshold-policy.yaml" + +do_install() { + install -D ${WORKDIR}/psu-threshold-policy.yaml ${D}${config_dir}/psu-threshold-policy.yaml +} + +FILES:${PN} += "${config_dir}/psu-threshold-policy.yaml" diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy/psu-threshold-policy.yaml b/meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy/psu-threshold-policy.yaml new file mode 100644 index 0000000000..98db0e2f9a --- /dev/null +++ b/meta-ibs/meta-common/recipes-phosphor/dbus/psu-threshold-policy/psu-threshold-policy.yaml @@ -0,0 +1,88 @@ +- name: chassis state + description: > + 'Witherspoon has a single chassis to monitor.' + class: group + group: path + members: + - meta: CHASSISSTATE + path: /xyz/openbmc_project/state/chassis0 + +- name: chassis powered + description: > + 'Monitor the chassis power state.' + class: group + group: property + type: string + members: + - interface: xyz.openbmc_project.State.Chassis + meta: CHASSIS_STATE + property: CurrentPowerState + +- name: watch chassis state + description: > + 'Trigger logic on chassis power state changes.' + class: watch + watch: property + paths: chassis state + properties: chassis powered + callback: check cooling type + +- name: check power on + description: > + 'If the chassis has power, enable PSU Thresholds.' + class: condition + condition: count + paths: chassis state + properties: chassis powered + callback: enable psu1 vout threshold + countop: '>' + countbound: 0 + op: '==' + bound: xyz.openbmc_project.State.Chassis.PowerState.On + +- name: check power off + description: > + 'If the chassis has power, enable PSU Thresholds.' + class: condition + condition: count + paths: chassis state + properties: chassis powered + callback: disable psu1 vout threshold + countop: '>' + countbound: 0 + op: '!=' + bound: xyz.openbmc_project.State.Chassis.PowerState.On + +- name: enable psu1 vout threshold + description: > + 'Enable PSU0 Vout' + class: callback + callback: method + service: xyz.openbmc_project.PSUSensor + path: /xyz/openbmc_project/sensors/voltage/PSU1_Output_Voltage + interface: org.freedesktop.DBus.Properties + method: Set + args: + - value: xyz.openbmc_project.State.Decorator.Availability + type: string + - value: Available + type: string + - value: true + type: boolean + +- name: disable psu0 vout threshold + description: > + 'Enable PSU0 Vout' + class: callback + callback: method + service: xyz.openbmc_project.PSUSensor + path: /xyz/openbmc_project/sensors/voltage/PSU1_Output_Voltage + interface: org.freedesktop.DBus.Properties + method: Set + args: + - value: xyz.openbmc_project.State.Decorator.Availability + type: string + - value: Available + type: string + - value: false + type: boolean diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager.bb b/meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager.bb deleted file mode 100644 index c0fd090b00..0000000000 --- a/meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager.bb +++ /dev/null @@ -1,17 +0,0 @@ -SUMMARY = "snmp policy configuration for meta-ibm machines" -PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -inherit allarch -inherit phosphor-dbus-monitor - -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" - -SRC_URI += "file://psu-threshold-config.yaml" - -do_install() { - install -D ${WORKDIR}/psu-threshold-config.yaml ${D}${config_dir}/psu-threshold-config.yaml -} - -FILES:${PN} += "${config_dir}/psu-threshold-config.yaml" diff --git a/meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager/snmp-config.yaml b/meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager/snmp-config.yaml deleted file mode 100644 index a168bde3f5..0000000000 --- a/meta-ibs/meta-common/recipes-phosphor/dbus/psu-thresholds-manager/snmp-config.yaml +++ /dev/null @@ -1,18 +0,0 @@ -- name: errorlog path group - class: group - group: path - members: - - meta: PATH - path: /xyz/openbmc_project/logging - -- name: pathwatch errorlog - class: pathwatch - pathwatch: path - paths: errorlog path group - pathcallback: create errorlog trap - -- name: create errorlog trap - class: pathcallback - pathcallback: eventpath - paths: errorlog path group - eventType: ErrorTrap -- cgit v1.2.3