1
0
mirror of https://github.com/AndrewX192/lenovo-sa120-fanspeed-utility synced 2025-12-06 01:23:19 +00:00
Files
2018-06-15 23:41:39 -05:00

69 lines
2.0 KiB
Markdown

# lenovo-sa120-fanspeed-utility
This is currently in prototype status.
## Requirements
Requires Python and the `sg_ses` utility, provided by [the `sg3_utils` package](http://sg.danny.cz/sg/sg3_utils.html).
Debian-based systems might use:
# apt-get install sg3-utils
On RHEL/CentOS systems:
# yum install sg3_utils
FreeBSD systems via `pkg`:
# pkg install sysutils/sg3_utils
FreeNAS 9.10 includes `sg_ses` as part of the standard image.
Solaris/OmniOS/OpenIndiana/SmartOS based systems:
Native Solaris should have sg3_utils installed. If executing `sg_ses` doesn't exist, it's necessary to install it from source. Installing napp-it, for the ZFS GUI, also installed all the requisite development tools.
On OmniOS CE, the steps involved were:
* Download [the `sg3_utils` package](http://sg.danny.cz/sg/sg3_utils.html). Move to somewhere like `/root` and extract.
* Change into the directory, configure with `./configure --prefix=/root/sg3_utils`.
* `make` && `make install`
* Run the fan script and set the path in the environment `sg_sess_path=/root/sg3_utils/bin/sg_ses python fancontrol.py 2`
## Usage
Finds the ThinkServer Enclosure automatically. Works when the devices are either `/dev/sg*`, `/dev/ses*`, or `/dev/bsg/*`
Use `fancontrol.py` to set the fan speed:
# python fancontrol.py 1
Enclosure not found on /dev/sg8
Enclosure not found on /dev/sg7
Enclosure found on /dev/sg6
Fan 0 speed: 1193
Fan 1 speed: 1205
Fan 2 speed: 1171
Fan 3 speed: 1217
Fan 4 speed: 1181
Fan 5 speed: 1218
Reading current configuration...
Setting fan 0 to 1
Setting fan 1 to 1
Setting fan 2 to 1
Setting fan 3 to 1
Setting fan 4 to 1
Setting fan 5 to 1
Set fan speeds... Waiting to get fan speeds (ctrl+c to skip)
LENOVO ThinkServerSA120 1008
Sending Enclosure Control [0x2] page, with page length=296 bytes
Fan 0 speed: 440
Fan 1 speed: 596
Fan 2 speed: 593
Fan 3 speed: 449
Fan 4 speed: 583
Fan 5 speed: 607