R710 (and probably other 11th Gen Dell servers) fan controller shell script.

Discussion in 'Software Stuff' started by Blue)(Fusion, Oct 29, 2017.

  1. Blue)(Fusion

    Blue)(Fusion Member

    Joined:
    Mar 1, 2017
    Messages:
    52
    Likes Received:
    7
    I just found out two days ago that there was a way to send raw hex code to the IPMI from another user pointing it out to me on this subreddit. I spent the next two days putting together a shell script to manage my R710 fan with multiple levels of fan speeds, user configuration CPU and HDD temp settings, and poll times. I'm pretty happy with the result.

    The down side is it is only working on a bare metal OS, meaning if you're using ESXi, it probably won't work.

    Requirements are:
    • ipmitool
    • MegaCLI (if a MegaRAID-based controller is in use)
    • smartmontools (if MegaCLI is unavailable or no MegaRAID-based controller in use)
    • lm_sensors
    • coretemp kernel module
    I've been running it better part of a day with many tests with kernel compilations and I'm pretty sure the bugs are squashed. At this point, I'm definitely welcome to feedback, but I prefer the constructive type. I am no professional programmer. It is merely a hobby so do not expect perfection.

    If you have an R610 or other 11th Generation Dell server with iDRAC, please let me know if this works for you or what tweaks need to be made.

    The script can be downloaded from: richgannon.net/projects/dellfanspeed

    To run it, simply save it to a location of your choice, and run it with sh r710_fan_controller.sh. You can run it in the background with screen or you can use the init system of your choice to create a way to background it as a kind of daemon script.
     
    #1
    SwanRonson, chilipepperz and leebo_28 like this.
  2. tarzanbigcity

    tarzanbigcity New Member

    Joined:
    Mar 19, 2017
    Messages:
    4
    Likes Received:
    1
    This was incredibly helpful thank you. I have the Poweredge T710, a very similar model. The fans in mine are probably a bit larger than the rackmount R710. I considered modifying the fans but dont have to now, as its barely audible. I am running the latest version of FreeNas on my box and just setup a startup script to execute after system init. My ears thank you. I am going to try putting the system through its paces now to make sure the new fan settings will keep temps in control under load.
     
    #2
    leebo_28 likes this.
  3. Blue)(Fusion

    Blue)(Fusion Member

    Joined:
    Mar 1, 2017
    Messages:
    52
    Likes Received:
    7
    Thanks for the compliment. Glad you find it useful. If you find fan speed values that you like with some trial and error, and can document the hex code to various RPMs and what works for your T710, I'll add that info for others to use, too.


    I also forgot to update this thread. It's much easier to run it as a service. On Proxmox, I added the following file.


    /etc/systemd/system/multi-user.target.wants/fan-controller.service :
    Code:
    [Unit]
    Description=Dell R510/R610/R710 IPMI Fan Controller
    After=multi-user.target
    
    [Service]
    ExecStart=/usr/local/dell_fan_controller/fan_controller.sh
    
    [Install]
    WantedBy=multi-user.target

    Then simply
    $ systemctl enable fan-controller
    $systemctl start fan-controller
     
    #3
    chilipepperz likes this.
  4. EffrafaxOfWug

    EffrafaxOfWug Radioactive Member

    Joined:
    Feb 12, 2015
    Messages:
    710
    Likes Received:
    249
    Missed this when you posted it but I see you're using either megacli or smartctl commands to get the temps. I don't know if you're aware of it or not, but you can get extremely fast temp readouts if you run hddtemp as a daemon; you can then listen direct to the local socket and get the info directly. As well as being quick, it's got the added bonus of automatically ignoring any drives that don't have a temperature sensor. It comes out in a slightly awkward pipe-separated format but nothing a bit of awk-fu can't handle.

    Here's what I use for my HDD temperature monitoring:
    Code:
    effrafax@wug:~$ nc localhost 7634|sed 's/^|//'|sed 's/|$//'|awk -F '[|][|]' -v OFS="\n" '{$1=$1}1'
    /dev/sda|TOSHIBA HDWN160|35|C
    /dev/sdb|TOSHIBA HDWN160|38|C
    /dev/sdc|TOSHIBA HDWN160|37|C
    /dev/sdd|TOSHIBA HDWN160|37|C
    /dev/sde|TOSHIBA HDWN160|36|C
    You can then loop through each line and extract any info you want for any field - I use that to run another script that goes off and extracts some further info and stores in an RRD database.
     
    #4
  5. Blue)(Fusion

    Blue)(Fusion Member

    Joined:
    Mar 1, 2017
    Messages:
    52
    Likes Received:
    7
    I TOTALLY forgot about hddtemp. I used to use it all the time on my laptop and desktops, too. I'll be adding that support in there, too. Keep in mind, I don't believe hddtemp works with RAID controllers, though, does it?
     
    #5
  6. EffrafaxOfWug

    EffrafaxOfWug Radioactive Member

    Joined:
    Feb 12, 2015
    Messages:
    710
    Likes Received:
    249
    I've not used a RAID controller in years I'm afraid (apart from at work, and those ones have proprietary monitor things and of course no-ones gives a toss about noise in the data centre) so I've never tested it myself. But stands to reason that it wouldn't work on most RAID cards, no, since they usually break the normal command protocols.
     
    #6
    Last edited: Jul 16, 2018
  7. Blue)(Fusion

    Blue)(Fusion Member

    Joined:
    Mar 1, 2017
    Messages:
    52
    Likes Received:
    7
    So you see, since this script is aimed primarily towards the [T|R][2-8]10 series, they almost all use RAID cards by default (Perc6/i, H200, H700). Only going outside the usual options does one have an HBA card installed in these devices, as far as I am aware. Not to say, this shouldn't include them. Many users use these as ZFS boxes with HBA mode cards. Myself, I am looking for an R510 12-bay to run in HBA mode for Btrfs + Glusterfs.
     
    #7
  8. tarzanbigcity

    tarzanbigcity New Member

    Joined:
    Mar 19, 2017
    Messages:
    4
    Likes Received:
    1
    I stuck in an LSI 9201-8i in IT mode, because I want to run FreeNAS off of it. Right now the script is returning a "sensors: not found" reading. I dont have any drive hooked up yet. Any chance it would support these cards, they are very common now? Many people are even crossflashing their Dell H200 to be a LSI-9211-8i. FreeNAS works best when drives are presented as simple disks.
     
    #8
  9. EffrafaxOfWug

    EffrafaxOfWug Radioactive Member

    Joined:
    Feb 12, 2015
    Messages:
    710
    Likes Received:
    249
    You likely don't have lm-sensors installed/configured which is what the script uses to ascertain temperatures from the coretemp module - although these can be extracted from sysfs directly rather than using lm-sensors.
     
    #9
  10. tarzanbigcity

    tarzanbigcity New Member

    Joined:
    Mar 19, 2017
    Messages:
    4
    Likes Received:
    1
    The lm-sensors package doesnt appear to be available for freenas. How do you set it up for sysfs?
     
    #10
  11. Blue)(Fusion

    Blue)(Fusion Member

    Joined:
    Mar 1, 2017
    Messages:
    52
    Likes Received:
    7
    Here's a good guide on FreeNAS and temperature monitoring:
    CPU Temp on GIGABYTE M/B

    Perhaps that may help out. I'm not at all familiar with FreeNAS so I'm of little use giving guidance.

    Regarding the LSI RAID card in IT mode, change the MEGARAID=1 to MEGARAID=0 and it will use smartmontools to grab the temperature. You will need smartmontools package installed. I can't imagine FreeNAS won't support this hard drive monitoring package.
     
    #11
  12. EffrafaxOfWug

    EffrafaxOfWug Radioactive Member

    Joined:
    Feb 12, 2015
    Messages:
    710
    Likes Received:
    249
    Aye I also missed the FreeNAS bit completely and was thinking with my linux hat on. The original script is linux-centric as well with the only cross-platform stuff being the smartctl/smartmontools commands - other bits of the script would need to be rewritten to work nicely with BSD/FreeNAS monitoring mechanisms.
     
    #12
  13. chilipepperz

    chilipepperz Active Member

    Joined:
    Mar 17, 2016
    Messages:
    169
    Likes Received:
    50
    This is great!
     
    #13
  14. tarzanbigcity

    tarzanbigcity New Member

    Joined:
    Mar 19, 2017
    Messages:
    4
    Likes Received:
    1
    After further research the RPM values are a bit different on the T710 because the fans are larger. Here is a basic grid of the raw hex applied and the resulting RPM value of the fans. Perhaps you can update your script for anyone with a tower pc. I find these to be the most tolerable while sitting next to me in my office.

    Enable manual/static fan speed
    ipmitool raw 0x30 0x30 0x01 0x00

    (1680 RPM)
    ipmitool raw 0x30 0x30 0x02 0xff 0x08

    (1800 RPM)
    ipmitool raw 0x30 0x30 0x02 0xff 0x0c

    (2040 RPM)
    ipmitool raw 0x30 0x30 0x02 0xff 0x10

    (2160 RPM)
    ipmitool raw 0x30 0x30 0x02 0xff 0x14

    (2280 RPM)
    ipmitool raw 0x30 0x30 0x02 0xff 0x18
     
    #14

Share This Page