summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Thangavel <thangavel.k@hcl.com>2022-07-15 18:03:28 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-07-27 18:56:53 +0300
commit29949f4d3851ce6b3a6073c1cdb6264b2628b334 (patch)
tree7b9ee27a7b246ab35d530c6d06a68fca59357fbd
parent9fe6f24ffa03f786db1f4c3ecf386f0fa5e4fbed (diff)
downloadopenbmc-29949f4d3851ce6b3a6073c1cdb6264b2628b334.tar.xz
meta-facebook: fby35 : Add support to take actions if Fan/NIC
sensor values crossed thresholds Added support to trigger hard shutdown alarms and power off the slots of the platform if the Fan/NIC sensors values getting low compared to threshold values. Added platform specific service file and script to take platorm specific actions. TESTED : Verified all the slots getting powered Off when fan/nic sensor values crossed threshold values. Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com> Change-Id: Icd1f761c08e8b829eef4f1d28ef68732600c296b
-rw-r--r--meta-facebook/recipes-phosphor/fans/phosphor-fan/fby35/host-poweroff28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta-facebook/recipes-phosphor/fans/phosphor-fan/fby35/host-poweroff b/meta-facebook/recipes-phosphor/fans/phosphor-fan/fby35/host-poweroff
new file mode 100644
index 0000000000..bd439542f8
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/fans/phosphor-fan/fby35/host-poweroff
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Power off the hosts when fan sensors crossed thresholds.
+
+echo "Power off the hosts if fansensors threshold crossed ::"
+
+HOST_INSTANCES="HOST_INSTANCES_SED_REPLACEMENT_VALUE"
+
+DBUS_SERVICE="xyz.openbmc_project.State.Chassis"
+DBUS_OBJECT="/xyz/openbmc_project/state/chassis"
+DBUS_INTERFACE="xyz.openbmc_project.State.Chassis"
+DBUS_PROPERTY="RequestedPowerTransition"
+PROPERTY_VALUE="xyz.openbmc_project.State.Chassis.Transition.Off"
+
+# Power off the hosts.
+power-off-all-hosts()
+{
+ for host_id in $HOST_INSTANCES
+ do
+ echo "chosen host id :::$host_id"
+
+ # host power off
+ output=$(busctl set-property $DBUS_SERVICE$host_id $DBUS_OBJECT$host_id $DBUS_INTERFACE $DBUS_PROPERTY s $PROPERTY_VALUE)
+ echo "$output"
+
+ done
+}
+
+power-off-all-hosts