Giter VIP home page Giter VIP logo

lenovo-sa120-fanspeed-utility's Introduction

lenovo-sa120-fanspeed-utility

This is currently in prototype status.

Requirements

Requires Python and the sg_ses utility, provided by the sg3_utils package.

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. 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

lenovo-sa120-fanspeed-utility's People

Contributors

andrewx192 avatar d10n avatar kroy-the-rabbit avatar sarog avatar smfsh avatar willglynn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lenovo-sa120-fanspeed-utility's Issues

Enclosure not found in CentOS 7

Using CentOS 7, the script was not able to find my SA120. It would appear that the sg_ses command does not support the flag "--maxlen=32768". After removing this argument from the script, it works just fine.

PR #5 breaks script

When #5 "Allows script to set fan speed on multiple enclosures" was merged in it broke the script with mixed tabs and spaces.

As-is it no longer works.

Fan 3 showing 0 RPM

I don't have any hardware error lights on, but the script always says Fan 3 is at 0 RPM. Which specific fan is that? I may try to replace one or all the fans, but I'm trying to narrow down which one might have failed.

Not working on Debian

Hooked one up to a proxmox box. All drives pop right in, but the script continually doesn't find the enclosure. these fans are driving me nuts.

Bad logic in the first few lines

if len(sys.argv) < 1:
    print("python fancontrol.py 1-7")
    sys.exit(-1)

fan = int(sys.argv[1])

if fan <= 0 or fan > 6:
    raise Exception("Fan speed must be between 1 and 7")
  1. len(sys.argv) < 1 will never happen because sys.argv[0] is always the name of the file

  2. if fan <= 0 or fan > 6 to get 1-7?? if fan < 1 or fan > 7 -- as-is picking 7 breaks script

            print("Enclosure found on " + device);
  1. there are no semi-colon endings in python

No Issue

I just wanted to say how great this is!!! Thanks for making life easy, man Open Source is just great

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.