Skip to content

Instantly share code, notes, and snippets.

@imfht
Created October 7, 2021 12:09
Show Gist options
  • Save imfht/c3ca6ce1d1b6daa6e063947061aa22e3 to your computer and use it in GitHub Desktop.
Save imfht/c3ca6ce1d1b6daa6e063947061aa22e3 to your computer and use it in GitHub Desktop.

Revisions

  1. imfht created this gist Oct 7, 2021.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/sh
    ipmi_host=idrac
    ipmi_user=root
    ipmi_passwd=xxxx
    temp_threshold="60"

    get_value=`ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd sensor reading "Temp" | cut -d "|" -f 2 | cut -d " " -f 2`

    if [[ $get_value > $temp_threshold ]]
    then
    ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd raw 0x30 0x30 0x01 0x01
    echo "set fans auto "
    else
    ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd raw 0x30 0x30 0x01 0x00
    ipmitool -I lanplus -H $ipmi_host -U $ipmi_user -P $ipmi_passwd raw 0x30 0x30 0x02 0xff 0x0a
    echo "set fans 1000"
    fi