How I Control My Dell PowerEdge R710's Fans Remotely with an API

How I Control My Dell PowerEdge R710's Fans Remotely with an API

·

4 min read

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Remotely monitoring my server's temperature and controlling the fan speed accordingly has been one of the more frustrating things I had to do. But that ends today! (Kind of...) Here's how I solved that issue with Python Flask and ipmitool.

[

GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server

A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server - GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Fl...

How I Control My Dell PowerEdge R710's Fans Remotely with an APIGitHubItsNee

How I Control My Dell PowerEdge R710's Fans Remotely with an API

](github.com/ItsNee/Dell-PowerEdge-R710-Fan-C..)


Prerequisites

  • A system in the same network as the server installed with Python 3(This could very well be the server itself or a virtual machine running on the server. Baseline: machine should be able to reach server without any network issues)
  • Dell Server with IDRAC and IPMI over LAN turned on

Solution to Issue

How I Control My Dell PowerEdge R710's Fans Remotely with an API

With the help of IPMI (Intelligent Platform Management Interface) over LAN, we would be able to query power supply usage, fan speed, server health, security details, and the state of operating systems. However, I'd be using this to query the server's temperature and change the fan speed.

One small hurdle is that we have to have a machine in the same network as the server (unless you want to expose your IPMI to the WWW). This bump can be overcome with the help of a custom made API exposed out to the internet through a reverse proxy. However its highly recommended that you obscure your API endpoint to prevent malicious actors from playing around with it. This can cause some serious damage to the hardware.

[

GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server

A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server - GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Fl...

How I Control My Dell PowerEdge R710's Fans Remotely with an APIGitHubItsNee

How I Control My Dell PowerEdge R710's Fans Remotely with an API

](github.com/ItsNee/Dell-PowerEdge-R710-Fan-C..)

Here's the simple Python Flask API Server that I wrote. It performs 2 simple but crucial tasks.

  • Get Current Server Temperature
  • Set Server Fan Speed

Setup

Installing ipmitool

The Flask application entirely depends on the system having the ipmitool utility. Let's go ahead and install that first

apt-get install ipmitool -y

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Installing Python3 and pip

apt-get install python3 python3-pip -y

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Clone Repository

git clone github.com/ItsNee/Dell-PowerEdge-R710-Fan-C..

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Installing Requirements

pip3 install -r requirements.txt

How I Control My Dell PowerEdge R710's Fans Remotely with an API


Run Server

Foreground

python3 api-server.py

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Background

Here's how to background the API Server.

nohup python3 api-server.py&

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Here's how to kill a background process:

Find the ProcessID

ps -faux | grep api-server

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Kill Process

kill -9 1085872


API Usage

api.myserver.com = [Returns a welcome string]

api.myserver.com/get-temperature = [Returns the server's temperature]

api.myserver.com/set-fan-speed = [ variable can be adjusted by end user]

How I Control My Dell PowerEdge R710's Fans Remotely with an API

How I Control My Dell PowerEdge R710's Fans Remotely with an API


IFTTT

IFTTT is a free application that I make use of in order to send web requests with a tap of a widget on my phone's home screen.

How I Control My Dell PowerEdge R710's Fans Remotely with an API

Creating an applet is as easy as picking "this" and "that". In my case, I went with "If button push, send web request"

How I Control My Dell PowerEdge R710's Fans Remotely with an API

How I Control My Dell PowerEdge R710's Fans Remotely with an API

How I Control My Dell PowerEdge R710's Fans Remotely with an API

And with that, I'm able to remotely change my server's Fan Speed with a push of a button from my phone's home screen!