/Main_Page

::You must have ninja focus to complete your mission::NinjaFocus::

IPMI Thermal Sensors

Views:


This is a little script to simplify gathering thermal sensor readings on linux boxes.

Before you can use it, you have to create a cache of sdr data for ipmitool to use:

# cd /var/cache/
# mkdir ipmitool
# chmod 0770 ipmitool
# cd ipmitool
# ipmitool sdr dump ./sdr
Dumping Sensor Data Repository to './sdr'
#!/bin/sh

# Outputs one line per sensor.
# Note for newer Intel Xeon processors the reading is not the actual
# temperature but the number of degress below an unknown, 
# hardwired thermal-shutdown temperature

# Sensor Data Repository cache to improve performance
# generate cache with "ipmitool sdr dump <filename>"
SDR_CACHE=/var/cache/ipmitool/sdr

case $1 in
        ambient)
                ID=7.1
                PATTERN="Ambient Temp"
        ;;
        cpu)
                ID=3
                PATTERN=^Temp
        ;;
        memory)
                ID=8.1
                PATTERN=
        ;;
        planar)
                ID=7.1
                PATTERN="^Planar Temp"
        ;;
        psu)
                ID=10
                PATTERN=^Temp
        ;;
         --help)
                echo "Usage: $(basename $0) <ambient|cpu|memory|planar|psu>"
                exit 0
        ;;
        *)
                echo "Unsupported Sensor" 1>&2
                exit 1
        ;;
esac


ipmitool -S "${SDR_CACHE}" sdr entity ${ID} | grep "${PATTERN}" | cut -d\| -f 5 | sed -e 's/[a-zA-Z ]*//g'

Main Menu

Personal tools

Toolbox