mirror of
https://github.com/ergosteur/ergo-proxmox-scripts.git
synced 2026-10-28 13:00:37 -04:00
Add IPMI fan control scripts, reading credentials from conf/
ipmi-fancontrol.service pins the fans to a fixed speed on start and hands control back to the BMC's automatic curve on stop, to quiet the chassis. BMC credentials are read from conf/ipmi-fancontrol.conf, resolved relative to the scripts themselves so the tree stays self-contained whether it is run from a checkout or from /opt/ergosteur. See conf/ipmi-fancontrol.conf.example. Use ipmitool -E rather than -P so the password is passed via the environment instead of argv, where any local user could read it out of ps. docker-idrac.sh is the alternative temperature-aware controller. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
5a661d728f
commit
be5cc9b505
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
# Put the BMC into manual fan control and pin the fans to a fixed speed.
|
||||
# Paired with ipmi-fancontrol-auto via ipmi-fancontrol.service.
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
CONFIG=${IPMI_FANCONTROL_CONFIG:-$SCRIPT_DIR/conf/ipmi-fancontrol.conf}
|
||||
|
||||
if [ ! -r "$CONFIG" ]; then
|
||||
echo "Error: cannot read $CONFIG" >&2
|
||||
echo "Copy conf/ipmi-fancontrol.conf.example there and fill in the BMC credentials." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. "$CONFIG"
|
||||
|
||||
: "${IPMI_HOST:?not set in $CONFIG}"
|
||||
: "${IPMI_USER:?not set in $CONFIG}"
|
||||
: "${IPMI_PASSWORD:?not set in $CONFIG}"
|
||||
: "${FAN_SPEED:=0x15}"
|
||||
|
||||
# ipmitool -E reads the password from IPMI_PASSWORD, keeping it out of argv.
|
||||
export IPMI_PASSWORD
|
||||
|
||||
# Disable the BMC's automatic fan curve.
|
||||
ipmitool -I lanplus -H "$IPMI_HOST" -U "$IPMI_USER" -E raw 0x30 0x30 0x01 0x00
|
||||
|
||||
# Apply the fixed speed to all fans.
|
||||
ipmitool -I lanplus -H "$IPMI_HOST" -U "$IPMI_USER" -E raw 0x30 0x30 0x02 0xff "$FAN_SPEED"
|
||||
Reference in New Issue
Block a user