summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--obmcutil21
1 files changed, 19 insertions, 2 deletions
diff --git a/obmcutil b/obmcutil
index 35a1752..68b5454 100644
--- a/obmcutil
+++ b/obmcutil
@@ -2,8 +2,10 @@
set -euo pipefail
+OPTS="bmcstate,bootprogress,chassisstate,hoststate,power,state,status"
+
USAGE="Usage: obmcutil [-h]
- {bmcstate,bootprogress,chassisstate,hoststate,state,status}"
+ {$OPTS}"
INTERFACE_ROOT=xyz.openbmc_project
STATE_INTERFACE=$INTERFACE_ROOT.State
@@ -16,7 +18,7 @@ print_help ()
echo "$USAGE"
echo ""
echo "positional arguments:"
- echo " {bmcstate,bootprogress,chassisstate,hoststate,state,status}"
+ echo " {$OPTS}"
echo ""
echo "optional arguments:"
echo " -h, --help show this help message and exit"
@@ -71,6 +73,21 @@ handle_cmd ()
PROPERTY=BootProgress
state_query $SERVICE $OBJECT $INTERFACE $PROPERTY
;;
+ power)
+ OBJECT=/org/openbmc/control/power0
+ SERVICE=$(mapper get-service $OBJECT)
+ INTERFACE=org.openbmc.control.Power
+ for property in pgood state pgood_timeout
+ do
+ # get_property can potentially return several
+ # different formats of values, so we do the parsing outside
+ # of get_property depending on the query. These queries
+ # return 'i VALUE' formatted strings.
+ STATE=$(get_property $SERVICE $OBJECT $INTERFACE $property \
+ | sed 's/i[ ^I]*//')
+ printf "%s = %s\n" $property $STATE
+ done
+ ;;
-h|--help)
print_help
;;
OpenPOWER on IntegriCloud