Matt Spinler | 2d38ad5 | 2022-09-08 10:42:42 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # config: 2 20 |
| 4 | # @brief: Get the fan monitor dump |
| 5 | # |
| 6 | |
| 7 | . $DREPORT_INCLUDE/functions |
| 8 | |
| 9 | if [ ! -e "/usr/bin/phosphor-fan-monitor" ]; then |
Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 10 | exit 0 |
Matt Spinler | 2d38ad5 | 2022-09-08 10:42:42 -0500 | [diff] [blame] | 11 | fi |
| 12 | |
| 13 | file_name="/tmp/fan_monitor_dump.json" |
| 14 | |
| 15 | rm -f $file_name |
| 16 | killall -s SIGUSR1 phosphor-fan-monitor |
| 17 | |
| 18 | seconds=0 |
| 19 | while [ ! -e "$file_name" ]; do |
| 20 | seconds=$(( seconds + 1 )) |
| 21 | if [ $seconds -eq 5 ]; then |
| 22 | echo "Timed out waiting for fan monitor dump" |
| 23 | exit 0 |
| 24 | fi |
| 25 | sleep 1 |
| 26 | done |
| 27 | |
| 28 | desc="fan monitor dump" |
| 29 | add_copy_file "$file_name" "$desc" |
| 30 | |
| 31 | rm -rf /tmp/fan_monitor_dump.json |