damianolombardo / idrac-ipmi-fan-controller

Automatically control Dell PowerEdge fans using IPMI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub release (latest by date including pre-releases) GitHub Workflow Status (event) GitHub


iDRAC IPMI Fan Controller

Automatically control Dell PowerEdge fans using IPMI

  1. About The Project
  2. Getting Started
  3. Usage (local)
  4. Usage (Docker)
  5. Tests
  6. Code style standards
  7. Contributing
  8. Acknowledgments

About The Project

This project allows you to automatically control your Dell PowerEdge fan speeds using IPMI tools determined by a customisable temperature range.

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

Installation (local)

After installing the projects prerequisites, you will need to install the projects python dependencies using pip3

  1. Install Python dependencies using pip3
    pip3 install -r requirements.txt

(back to top)

Environment variables

This project depends on several environment variables being available to the script, these are described below

Variable Default Description
IDRAC_HOST null IP address of your iDRAC host
IDRAC_USERNAME null Username of your iDRAC host
IDRAC_PASSWORD null Password of your iDRAC host
TEMP_RANGES null Pipe-separated list of temperature ranges, see below for more details

(back to top)

Temperature ranges

The temperature ranges environment variable allows you to define a range of temperatures and your desired fan speed (as a percentage). This is set using a pipe-separated string provided as an environment variable (TEMP_RANGES).

Format:
[start of range], [end of range], [fan speed percentage]|[start of range], [end of range], [fan speed percentage]

For example:
30, 40, 5|40, 45, 8|45, 50, 10|50, 55, 20|55, 100, static

This will be parsed as:

Temperature Fan speed
30c to 40c 5%
40c to 45c 8%
45c to 50c 10%
50c to 55c 20%
55c to 100c static

static fan speed mode will turn off manual fan control and allow iDRAC to determine what speed the fans should be for the current temperature (default behaviour).

If there isn't a temperature range configured, this tool will use the closest temperature range based on the highest temperature sensor.

(back to top)

Usage (local)

To run the project locally, execute the controller.py file

python3 controller.py

Usage (Docker)

You can run this project using docker by pulling and running the pre-build image using the following command

docker run -d \
  --name iDRAC_IPMI_fan_controller \
  --restart=unless-stopped \
  -e IDRAC_HOST=<iDRAC host> \
  -e IDRAC_USERNAME=<iDRAC username> \
  -e IDRAC_PASSWORD=<iDRAC password> \
  -e TEMP_RANGES=<pipe seperated list of temp ranges> \
  jamiesage123/idrac-ipmi-fan-controller:latest

(back to top)

Tests

Tests are located in the tests directory. Before you can run the tests, you must install the test dependencies using pip3

  1. Install test dependencies using pip3
    pip3 install -r tests/requirements.txt

You can now run the project tests

  1. Run pytest
    pytest tests

This project aims to have >= 95% test coverage. You can check the projects test coverage by running:

  1. Test coverage
    coverage run -m pytest tests

Code style standards

This project uses Flake8 to enforce code style standards to style conventions in PEP 8.

You can run Flake8 by installing the test dependencies and then running:

  1. Run lint
    flake8 . --count --max-complexity=10 --max-line-length=127 --statistics

Contributing

Contributions make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion to improve this, please fork the repo and create a pull request. You can also open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Acknowledgments

Use this project at your own risk and responsibility. Overriding default behaviour may cause irreversible damage to hardware. Always monitor and ensure your hardware is running at safe temperatures.

This project is released under the MIT License.

(back to top)

About

Automatically control Dell PowerEdge fans using IPMI

License:MIT License


Languages

Language:Python 99.5%Language:Dockerfile 0.5%