| Jayanth Othayoth | f8f6d55 | 2017-10-15 05:34:37 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| Marri Devender Rao | 6d7f753 | 2018-12-04 09:10:02 -0600 | [diff] [blame] | 3 | # config: 1234 5 |
| Jayanth Othayoth | f8f6d55 | 2017-10-15 05:34:37 -0500 | [diff] [blame] | 4 | # @brief: Collect Chassis state information. |
| 5 | # |
| 6 | |
| 7 | . $DREPORT_INCLUDE/functions |
| 8 | |
| Amithash Prasad | 734c41e | 2025-10-02 14:50:25 -0700 | [diff] [blame^] | 9 | services=$(busctl list | awk '{print $1}' | grep -E "xyz.openbmc_project.State.Chassis([0-9]*)?$") |
| 10 | for service in ${services}; do |
| 11 | objpath=$(busctl tree --list $service | tail -n 1) |
| 12 | index=$(echo "$service" | grep -o '[0-9]*$') |
| 13 | if [ -z "$index" ]; then |
| 14 | file_name="chassis-state.log" |
| 15 | desc="Chassis State" |
| 16 | else |
| 17 | file_name="chassis${index}-state.log" |
| 18 | desc="Chassis${index} State" |
| 19 | fi |
| 20 | command="busctl get-property ${service} ${objpath} \ |
| 21 | xyz.openbmc_project.State.Chassis CurrentPowerState" |
| 22 | add_cmd_output "$command" "$file_name" "$desc" |
| 23 | done |