xref: /openbmc/openpower-debug-collector/dump/tools/bmcdump/plugins/occ (revision eb46252d1f95edcc2cf1415dc71cfa36e8da785c)
124226c4fSGopichand Paturi#!/usr/bin/env bash
224226c4fSGopichand Paturi#
324226c4fSGopichand Paturi# config: 234 10
424226c4fSGopichand Paturi# @brief: Get the occ information.
524226c4fSGopichand Paturi#
624226c4fSGopichand Paturi
724226c4fSGopichand Paturi# shellcheck disable=SC1091
824226c4fSGopichand Paturi. "$DREPORT_INCLUDE"/functions
924226c4fSGopichand Paturi
1024226c4fSGopichand Paturi#fetch occ control data
1124226c4fSGopichand Paturifile_name="occ.log"
1224226c4fSGopichand Paturi
1324226c4fSGopichand Paturidesc="occ control"
1424226c4fSGopichand Paturicommand="busctl call --verbose --no-pager \
1524226c4fSGopichand Paturi                org.open_power.OCC.Control \
1624226c4fSGopichand Paturi                /org/open_power/control \
1724226c4fSGopichand Paturi                org.freedesktop.DBus.ObjectManager \
1824226c4fSGopichand Paturi                GetManagedObjects"
1924226c4fSGopichand Paturi
2024226c4fSGopichand Paturiadd_cmd_output "$command" "$file_name" "$desc"
2124226c4fSGopichand Paturi
2224226c4fSGopichand Paturi#fetch occ control host data
23*eb46252dSManojkiran Edadesc="occ control host"
2424226c4fSGopichand Paturicommand="busctl call --verbose --no-pager \
2524226c4fSGopichand Paturi                org.open_power.OCC.Control \
2624226c4fSGopichand Paturi                /xyz/openbmc_project/control \
2724226c4fSGopichand Paturi                org.freedesktop.DBus.ObjectManager \
2824226c4fSGopichand Paturi                GetManagedObjects"
2924226c4fSGopichand Paturiadd_cmd_output "$command" "$file_name" "$desc"
3024226c4fSGopichand Paturi
3124226c4fSGopichand Paturi#fetch occ sensors data
3224226c4fSGopichand Paturidesc="occ sensor"
3324226c4fSGopichand Paturicommand="busctl call --verbose --no-pager \
3424226c4fSGopichand Paturi                org.open_power.OCC.Control \
3524226c4fSGopichand Paturi                /xyz/openbmc_project/sensors \
3624226c4fSGopichand Paturi                org.freedesktop.DBus.ObjectManager \
3724226c4fSGopichand Paturi                GetManagedObjects"
3824226c4fSGopichand Paturiadd_cmd_output "$command" "$file_name" "$desc"
3924226c4fSGopichand Paturi
4024226c4fSGopichand Paturiocc_dir="/var/lib/openpower-occ-control"
4124226c4fSGopichand Paturiif [ -d "$occ_dir" ]; then
4224226c4fSGopichand Paturi    add_copy_file "$occ_dir" "$desc"
4324226c4fSGopichand Paturifi
44