blob: 0e34eef550c3a73230c772ab4f2071a36d91014b [file] [log] [blame]
Matt Spinler2d38ad52022-09-08 10:42:42 -05001#!/bin/bash
2#
3# config: 2 20
4# @brief: Get the fan monitor dump
5#
6
7. $DREPORT_INCLUDE/functions
8
9if [ ! -e "/usr/bin/phosphor-fan-monitor" ]; then
Patrick Williams9d26e4f2022-12-08 06:46:44 -060010 exit 0
Matt Spinler2d38ad52022-09-08 10:42:42 -050011fi
12
13file_name="/tmp/fan_monitor_dump.json"
14
15rm -f $file_name
16killall -s SIGUSR1 phosphor-fan-monitor
17
18seconds=0
19while [ ! -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
26done
27
28desc="fan monitor dump"
29add_copy_file "$file_name" "$desc"
30
31rm -rf /tmp/fan_monitor_dump.json