diff options
author | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2022-10-07 05:15:39 +0300 |
---|---|---|
committer | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2022-10-10 09:20:44 +0300 |
commit | f5ea9eb09e77c984f0c51151b0011cc3c595c63b (patch) | |
tree | 9d2369aa7353562366a51f7d313335c3942df899 /meta-ampere/meta-jade/recipes-phosphor/sensors | |
parent | e45b72906aae8cdefb763bd68734f1befd114f38 (diff) | |
download | openbmc-f5ea9eb09e77c984f0c51151b0011cc3c595c63b.tar.xz |
meta-ampere: mtjade: correct virtual sensor expression
Correct expression to calculate nvme_bp_max and nvme_m2_max sensors in
case missing nvmeX sensors
Tested:
1. Unplug all NVMe drives, and check if they are all 0
2. Plug some in abitrary slots and check if they have correct values,
not n/a
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: If0cc4e05b540394d15ed6bde3f04bcb13887477d
Diffstat (limited to 'meta-ampere/meta-jade/recipes-phosphor/sensors')
-rw-r--r-- | meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json index eabda2e3bd..3bc8bf38ae 100644 --- a/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json +++ b/meta-ampere/meta-jade/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json @@ -46,15 +46,11 @@ "Expression": "((P0 == P0) ? P0 : 0) + ((P1 == P1) ? P1 : 0)" }, { - "Desc": { - "Name": "S1_CPU_Pwr", - "SensorType": "power" - }, - "Threshold" : - { - "CriticalHigh": 500 + "Desc":{ + "Name":"nvme_bp_max", + "SensorType":"temperature" }, - "Associations": + "Associations": [ [ "chassis", @@ -67,31 +63,6 @@ "/xyz/openbmc_project/inventory/system/chassis/Mt_Jade" ] ], - "Params": { - "DbusParam": [ - { - "ParamName": "P1", - "Desc": { - "Name": "S1_Core_VRD_Pwr", - "SensorType": "power" - } - }, - { - "ParamName": "P2", - "Desc": { - "Name": "S1_SOC_VRD_Pwr", - "SensorType": "power" - } - } - ] - }, - "Expression": "(P1 + P2) >= 0 ? (P1 + P2) : NULL" - }, - { - "Desc":{ - "Name":"nvme_bp_max", - "SensorType":"temperature" - }, "Params":{ "DbusParam": [ { @@ -264,13 +235,26 @@ } ] }, - "Expression": "max(0,(n0 == n0) ? n0 : NULL,(n1 == n1) ? n1 : NULL,(n2 == n2) ? n2 : NULL,(n3 == n3) ? n3 : NULL,(n4 == n4) ? n4 : NULL,(n5 == n5) ? n5 : NULL,(n6 == n6) ? n6 : NULL,(n7 == n7) ? n7 : NULL,(n8 == n8) ? n8 : NULL,(n9 == n9) ? n9 : NULL,(n10 == n10) ? n10 : NULL,(n11 == n11) ? n11 : NULL,(n12 == n12) ? n12 : NULL,(n13 == n13) ? n13 : NULL,(n14 == n14) ? n14 : NULL,(n15 == n15) ? n15 : NULL,(n16 == n16) ? n16 : NULL,(n17 == n17) ? n17 : NULL,(n18 == n18) ? n18 : NULL,(n19 == n19) ? n19 : NULL,(n20 == n20) ? n20 : NULL,(n21 == n21) ? n21 : NULL,(n22 == n22) ? n22 : NULL,(n23 == n23) ? n23 : NULL)" + "Expression": "max((n0 == n0) ? n0 : 0,(n1 == n1) ? n1 : 0,(n2 == n2) ? n2 : 0,(n3 == n3) ? n3 : 0,(n4 == n4) ? n4 : 0,(n5 == n5) ? n5 : 0,(n6 == n6) ? n6 : 0,(n7 == n7) ? n7 : 0,(n8 == n8) ? n8 : 0,(n9 == n9) ? n9 : 0,(n10 == n10) ? n10 : 0,(n11 == n11) ? n11 : 0,(n12 == n12) ? n12 : 0,(n13 == n13) ? n13 : 0,(n14 == n14) ? n14 : 0,(n15 == n15) ? n15 : 0,(n16 == n16) ? n16 : 0,(n17 == n17) ? n17 : 0,(n18 == n18) ? n18 : 0,(n19 == n19) ? n19 : 0,(n20 == n20) ? n20 : 0,(n21 == n21) ? n21 : 0,(n22 == n22) ? n22 : 0,(n23 == n23) ? n23 : 0)" }, { "Desc":{ "Name":"nvme_m2_max", "SensorType":"temperature" }, + "Associations": + [ + [ + "chassis", + "all_sensors", + "/xyz/openbmc_project/inventory/system/chassis/Mt_Jade" + ], + [ + "inventory", + "sensors", + "/xyz/openbmc_project/inventory/system/chassis/Mt_Jade" + ] + ], "Params":{ "DbusParam": [ { @@ -289,7 +273,7 @@ } ] }, - "Expression": "max(0,(n24 == n24) ? n24 : NULL,(n25 == n25) ? n25 : NULL)" + "Expression": "max((n24 == n24) ? n24 : 0,(n25 == n25) ? n25 : 0)" } ] |