Dell iDRAC fan control automation. This script works on iDRAC versions up to 3.30.30.30. You can run this on your local machine, ideally macOS or Linux. If you're using Windows, it's recommended to use WSL (Windows Subsystem for Linux).
Before running the script, ensure you meet the following requirements:
ipmitool
must be installed:
- On Ubuntu/Debian:
sudo apt install ipmitool
- On macOS (using Homebrew):
brew install ipmitool
- IPMI over LAN must be enabled in the iDRAC settings:
- Navigate to
iDRAC -> iDRAC Settings -> Network
and ensure IPMI over LAN is enabled.
- User Permissions:
- Your user must have permission to access IPMI. The default
root
user typically has permission.
- Credentials Management: The script securely stores and manages your iDRAC credentials in a
.env
file, encoded using base64. - Input Validation: It validates the IP address and fan speed inputs.
- Error Handling: Provides clear error messages for issues such as incorrect credentials or IP address.
- IP Caching: It caches the last used IP address for convenience, so you don't need to enter it every time.
To quickly download and run the script, use the following one-liner:
bash <(curl -s https://raw.githubusercontent.com/alexpitcher/idrac-fan/refs/heads/main/main.sh)
Alternatively, if you prefer using wget
:
bash <(wget -qO- https://raw.githubusercontent.com/alexpitcher/idrac-fan/refs/heads/main/main.sh)
This command will fetch the script from GitHub and execute it directly on your system.
To run the script manually, use this command:
chmod +x ipmi_fan_control.sh
/ipmi_fan_control.sh [--verbose] [IP_ADDRESS] [FAN_SPEED]
--verbose
(optional): Enables verbose logging, outputting debug messages for troubleshooting.IP_ADDRESS
: The IP address of the iDRAC interface. If not provided, you will be prompted for it.FAN_SPEED
: The desired fan speed in percentage (0-100). If not provided, you will be prompted for it.
Example:
./ipmi_fan_control.sh --verbose 192.168.1.100 75
This example runs the script in verbose mode, connects to 192.168.1.100
, and sets the fan speed to 75%.
The script uses a .env
file to store the encoded credentials (username and password) and the last used IP address. This file is created if it doesn't exist, and you will be prompted to enter your credentials.
ENCODED_USER=dXNlcjE=
ENCODED_PASS=cGFzc3dvcmQxMjM=
LAST_IP=192.168.1.100
The credentials are stored in base64 encoded form to ensure they are not in plain text.
The script checks for common error messages from ipmitool
:
- Incorrect Username: Authentication fails with the message
RAKP 2 message indicates an error : unauthorized name
. - Incorrect Password: Authentication fails with the message
RAKP 2 HMAC is invalid
. - Incorrect IP Address: The IP address may be unreachable, with the error message
Get Auth Capabilities error
.
If the fan speed cannot be set, the script will provide additional details from the ipmitool
output.
[DEBUG] Sending IPMI command to initialize fan control with verbose output...
[DEBUG] Successfully initialized fan control.
[DEBUG] Sending IPMI command to set fan speed with verbose output...
[ERROR] Authentication failed: Incorrect password.
Enable verbose output by running the script with the --verbose
flag. This will print debug messages to help you understand the script's execution and troubleshoot issues.
This script is provided under the MIT License. Feel free to modify and use it as needed.