1#!/usr/bin/env bash
2#
3# config: 234 10
4# @brief: Get the occ information.
5#
6
7# shellcheck disable=SC1091
8. "$DREPORT_INCLUDE"/functions
9
10#fetch occ control data
11file_name="occ.log"
12
13desc="occ control"
14command="busctl call --verbose --no-pager \
15                org.open_power.OCC.Control \
16                /org/open_power/control \
17                org.freedesktop.DBus.ObjectManager \
18                GetManagedObjects"
19
20add_cmd_output "$command" "$file_name" "$desc"
21
22#fetch occ control host data
23desc="occ conrol host"
24command="busctl call --verbose --no-pager \
25                org.open_power.OCC.Control \
26                /xyz/openbmc_project/control \
27                org.freedesktop.DBus.ObjectManager \
28                GetManagedObjects"
29add_cmd_output "$command" "$file_name" "$desc"
30
31#fetch occ sensors data
32desc="occ sensor"
33command="busctl call --verbose --no-pager \
34                org.open_power.OCC.Control \
35                /xyz/openbmc_project/sensors \
36                org.freedesktop.DBus.ObjectManager \
37                GetManagedObjects"
38add_cmd_output "$command" "$file_name" "$desc"
39
40occ_dir="/var/lib/openpower-occ-control"
41if [ -d "$occ_dir" ]; then
42    add_copy_file "$occ_dir" "$desc"
43fi
44