forked from glorious1/spin_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspinpid2.config
executable file
·102 lines (79 loc) · 3.99 KB
/
spinpid2.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/local/bin/bash
# Config file for spinpid2.sh, beginning version 2020-06-17, for dual fan zones.
# Minor changes 2020-08-20, but 2020-06-17 config
# is still compatible with 2020-08-20 spinpid2.sh.
# Path to ipmitool. If you're doing VM
# you may need to add (inside quotes) the following to
# remotely execute commands.
# -H <hostname/ip> -U <username> -P <password>
IPMITOOL="/usr/local/bin/ipmitool"
################# OUTPUT SETTINGS ################
# Change to your desired log location/name or it will be put
# in the directory above (..) the one with the script.
LOG=/var/log/spinpid2.log
# LOG=$(dirname "${BASH_SOURCE[0]}")/../spinpid2.log
# Where do you want output to go? Comment/uncomment (#) to select.
# First sends output to the log file AND to screen/console, good for testing.
# Second goes only to log file, no feedback if running manually, but doesn't take over console.
# In the first, if you want to append to existing log, add '-a' to the tee command.
exec > >(tee -i $LOG) 2>&1 # Log + console, good for testing
# exec &> $LOG # Log only
# CPU output is sent to a separate log for interim cycles
# It can get big so turn off after testing. 1 = log cpu; anything else = don't log cpu
CPU_LOG_YES=0
# Path/name of cpu log
# CPU_LOG=/mnt/MyPool/MyDataSet/MyDirectory/cpu.log
CPU_LOG=$(dirname "${BASH_SOURCE[0]}")/cpu.log
################# FAN SETTINGS ################
# Supermicro says:
# Zone 0 - CPU/System fans, headers with number (e.g., FAN1, FAN2, etc.)
# Zone 1 - Peripheral fans, headers with letter (e.g., FANA, FANB, etc.)
# Some want the reverse (i.e, drive cooling fans on headers FAN1-4 and
# CPU fan on FANA), so that's the default. But you can switch to SM way.
# Supermicro boards with 7 headers will nearly always want Zone 1 for CPU (FANA, FANB), and Zone 2 for PER (FAN1..5)
ZONE_CPU=1
ZONE_PER=0
# Set min and max duty cycle to avoid stalling or zombie apocalypse
# Warning; Some Noctua Fan models, run slower than others at the same duty cycle, and stall around 300RPM. For myself this meant MIN=25% to stop the fans stalling and revving continuoyusly
DUTY_PER_MIN=25
DUTY_PER_MAX=100
DUTY_CPU_MIN=20
DUTY_CPU_MAX=100
# Using spintest.sh, measure fan RPMs at 30% duty cycle and 100% duty cycle.
# RPM_CPU is for FANA if ZONE_CPU=1 or FAN1 if ZONE_CPU=0
# RPM_PER is for the other fan.
RPM_CPU_30=900
RPM_CPU_MAX=2500
RPM_PER_30=400
RPM_PER_MAX=1200
# How should we determine what the fan duty (% of full power) is?
# Normally we want to read that from the board (HOW_DUTY=1).
# However, some dual-zone boards report incorrect fan duty,
# and then we need to assume duty is what we set last time (HOW_DUTY=0)
# (1) let the script read it
# (0 or any other value) assume it's where it was set.
HOW_DUTY=1
################# DRIVE SETTINGS ################
SP=43 # Setpoint mean drive temperature (C)
# Time interval for checking drives (minutes). Drives change
# temperature slowly; 5 minutes is probably frequent enough.
DRIVE_T=5
# Tunable constants for drive control (see comments at end of script)
Kp=4 # Proportional tunable constant
Kd=40 # Derivative tunable constant
################# CPU SETTINGS ################
# Time interval for checking CPU (seconds). 1 to 12 may be appropriate
CPU_T=5
# Reference temperature (C) for scaling CPU_DUTY (NOT a setpoint).
# At and below this temperature, CPU will demand minimum
# duty cycle (DUTY_CPU_MIN).
CPU_REF=50 # Integer only!
# Scalar for scaling CPU_DUTY.
# CPU will demand this number of percentage points in additional
# duty cycle for each degree of temperature above CPU_REF.
CPU_SCALE=5 # Integer only!
################# OPTIONAL ################
# If you wish to implement user-defined actions after Drives_check_adjust()
# and CPU_check_adjust(), you can define Post_DRIVES_check_adjust()
# and Post_CPU_check_adjust() here.
# For example, barbierimc set up Grafana to graph the data: https://www.ixsystems.com/community/threads/fan-scripts-for-supermicro-boards-using-pid-logic.51054/post-555603