Skip to content

Commit

Permalink
common: mfg-tool: add table-sensor-display
Browse files Browse the repository at this point in the history
Summary:
Add script to convert sensor-display output from JSON format to table view.

Tested result:
```
root@bmc:~# mfg-tool sensor-display 2>/dev/null | table-sensor-display
sensor  status  value   units   UNR     UCR     UNC     LNC     LCR     LNR
------  ------  -----   -----   ---     ---     ---     ---     ---     ---
FAN0_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN0_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN0_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN1_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN1_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN1_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN2_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN2_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN2_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN3_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN3_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN3_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN4_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN4_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN4_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN5_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN5_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN5_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN6_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN6_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN6_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN7_PWM        ok      100     Percent N/A     N/A     N/A     N/A     N/A     N/A
FAN7_TACH_IL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FAN7_TACH_OL    ok      0       RPMS    N/A     N/A     N/A     N/A     N/A     N/A
FIOBOARD_REMOTE_TEMP_C  ok      25.125  DegreesC        N/A     N/A     N/A     N/A     N/A     N/A
FIOBOARD_TEMP_C ok      25.875  DegreesC        N/A     N/A     N/A     N/A     N/A     N/A
......
SCM_P12V_VOLT_V ok      12.1218 Volts   N/A     10.8    N/A     N/A     13.2    N/A
SCM_P1V0_VOLT_V ok      1.008   Volts   N/A     0.9     N/A     N/A     1.1     N/A
SCM_P1V2_VOLT_V ok      1.198   Volts   N/A     1.14    N/A     N/A     1.26    N/A
SCM_P1V8_VOLT_V ok      1.8042  Volts   N/A     1.62    N/A     N/A     1.98    N/A
SCM_P2V5_VOLT_V ok      2.5037  Volts   N/A     2.375   N/A     N/A     2.625   N/A
SCM_P3V3_VOLT_V ok      3.3092  Volts   N/A     3       N/A     N/A     3.6     N/A
SCM_P3V_BAT_VOLT_V      critical        0.129   Volts   N/A     2.6     N/A     N/A     3.4     N/A
SCM_P5V_VOLT_V  ok      5.0011  Volts   N/A     4.75    N/A     N/A     5.25    N/A
SCM_PGPPA_VOLT_V        ok      1.8068  Volts   N/A     1.62    N/A     N/A     3.6     N/A
SCM_TEMP_C      ok      30.75   DegreesC        N/A     N/A     N/A     N/A     N/A     N/A
bmc/cpu/kernel  ok      5.3398  Percent N/A     N/A     N/A     N/A     N/A     N/A
bmc/cpu/total   ok      6.7961  Percent N/A     N/A     N/A     80      90      N/A
bmc/cpu/user    ok      1.4563  Percent N/A     N/A     N/A     N/A     N/A     N/A
bmc/memory/available    ok      762171392       Bytes   N/A     103322009.6     154983014.4     N/A     N/A     N/A
bmc/memory/buffered_and_cached  ok      163561472       Bytes   N/A     N/A     N/A     N/A     N/A     N/A
bmc/memory/free ok      775598080       Bytes   N/A     N/A     N/A     N/A     N/A     N/A
bmc/memory/shared       ok      761856  Bytes   N/A     N/A     N/A     N/A     878237081.6     N/A
bmc/memory/total        ok      1033220096      Bytes   N/A     N/A     N/A     N/A     N/A     N/A
bmc/storage/rw  ok      25243648        Bytes   N/A     1438515.2       2877030.4       N/A     N/A     N/A
bmc/storage/tmp ok      516612096       Bytes   N/A     51661209.6      77491814.4      N/A     N/A     N/A
```

X-link: facebookexternal/openbmc.quanta#4375

Reviewed By: amithash

Differential Revision: D59920230

fbshipit-source-id: 0cd177f7a32728f9ab67570b74295dd27830bc1e
  • Loading branch information
potinlai authored and facebook-github-bot committed Jul 19, 2024
1 parent befd008 commit 1486cae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

jq --raw-output '
def roundit: if . then (.*10000.0|round/10000.0) else "N/A" end;
(["sensor", "status", "value", "units", "UNR", "UCR", "UNC", "LNC", "LCR", "LNR"] | (., map(length*"-"))),
(to_entries[] | [
.key,
.value.status,
(.value.value | roundit),
.value.unit,
(.value."hard-shutdown".low | roundit),
(.value.critical.low | roundit),
(.value.warning.low | roundit),
(.value.warning.high | roundit),
(.value.critical.high | roundit),
(.value."hard-shutdown".high | roundit)
]) | @tsv
'
9 changes: 9 additions & 0 deletions common/recipes-lfopenbmc/mfg-tool/mfg-tool_1.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LOCAL_URI = " \
file://mfg-tool.cpp \
file://cmd \
file://utils \
file://scripts \
"

DEPENDS += " \
Expand All @@ -21,3 +22,11 @@ DEPENDS += " \
phosphor-logging \
sdbusplus \
"

RDEPENDS:${PN} += " \
bash \
"

do_install:append() {
install -m 755 ${S}/scripts/table-sensor-display ${D}${bindir}/table-sensor-display
}

0 comments on commit 1486cae

Please sign in to comment.