Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script to automatically set fan speed during parity check for Dell R720XD

Featured Replies

I just wanted to share this since it's helped me and I thought others might find it useful. This script checks for when parity check is running and automatically sets the fan speed to 60% then automatically reverts back to automatic control when parity check ends. You can set the speed to whatever you want I just find 60% works well for my specific circumstances. 

 

 

This was made with chatgpt so please excuse if there is a better way of doing this, I'd appreciate any feedback if it could be improved.

 

#!/bin/bash

# Configuration
IPMI_USER="enter username"             # IPMI username
IPMI_PASS='enter password'             # IPMI password
IPMI_IP="enter ip of server"           # IPMI IP address
FAN_SPEED=60                           # Desired fan speed percentage (60%), only used to display fan speed %
CHECK_INTERVAL=60                      # Time (in seconds) between checks
LOG_FILE="/mnt/user/appdata/scripts/fan_control.log"

# Commands to enable manual fan control, set fan speed, and revert to automatic
ENABLE_MANUAL_FAN_CMD="ipmitool -I lanplus -H $IPMI_IP -U $IPMI_USER -P $IPMI_PASS raw 0x30 0x30 0x01 0x00"
SET_FAN_SPEED_CMD="ipmitool -I lanplus -H $IPMI_IP -U $IPMI_USER -P $IPMI_PASS raw 0x30 0x30 0x02 0xff 0x3C"
SET_AUTO_FAN_CMD="ipmitool -I lanplus -H $IPMI_IP -U $IPMI_USER -P $IPMI_PASS raw 0x30 0x30 0x01 0x01"

# Function to log events with a timestamp
log_event() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> $LOG_FILE
}

# Function to check if a parity check is running based on mdResync
is_parity_check_running() {
    mdResync=$(mdcmd status | grep -oP 'mdResync=\K[0-9]+')
    if [[ "$mdResync" -gt 0 ]]; then
        return 0  # Parity check is running
    else
        return 1  # Parity check is not running
    fi
}

# Main script loop
log_event "Starting IPMI Fan Control Script for Parity Check..."
FAN_SPEED_SET=false
MANUAL_CONTROL_ENABLED=false

while true; do
    if is_parity_check_running; then
        # If a parity check is running
        if [ "$FAN_SPEED_SET" = false ]; then
            # Enable manual fan control only once when parity check starts
            if [ "$MANUAL_CONTROL_ENABLED" = false ]; then
                log_event "Enabling manual fan control..."
                eval $ENABLE_MANUAL_FAN_CMD
                MANUAL_CONTROL_ENABLED=true
            fi

            # Set fan speed to 60% once when parity check starts
            log_event "Parity check detected. Setting fan speed to ${FAN_SPEED}%. "
            eval $SET_FAN_SPEED_CMD
            FAN_SPEED_SET=true
        fi
    else
        # If no parity check is running
        if [ "$FAN_SPEED_SET" = true ]; then
            # Revert to automatic fan control after parity check completes
            log_event "Parity check completed. Reverting fan control to automatic."
            eval $SET_AUTO_FAN_CMD
            FAN_SPEED_SET=false
            MANUAL_CONTROL_ENABLED=false
        fi
    fi
    sleep $CHECK_INTERVAL
done

 

Edited by Android_18

  • Android_18 changed the title to Script to automatically set fan speed during parity check for Dell R720XD

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.