238 lines
6.5 KiB
Markdown
238 lines
6.5 KiB
Markdown
# IPMI Fan Control
|
|
|
|
A modern web-based application for controlling fan speeds on Dell T710 and compatible servers using IPMI. Features a clean web UI, automatic fan curves, panic mode for safety, and support for multiple servers.
|
|
|
|

|
|
|
|
## Features
|
|
|
|
- 🖥️ **Multiple Server Support** - Manage multiple servers from a single interface
|
|
- 🌡️ **Temperature-Based Fan Curves** - Automatically adjust fan speeds based on CPU temperatures
|
|
- ⚡ **Panic Mode** - Automatically sets fans to 100% if sensor data is lost
|
|
- 🎛️ **Manual Fan Control** - Direct control over individual fans or all fans at once
|
|
- 📊 **Real-time Monitoring** - View temperatures, fan speeds, and power consumption
|
|
- 🔒 **Secure Authentication** - JWT-based authentication with encrypted passwords
|
|
- 🐳 **Docker Support** - Easy deployment with Docker Compose
|
|
- 🔄 **Persistent Storage** - Settings and credentials survive container restarts
|
|
|
|
## Supported Servers
|
|
|
|
- Dell PowerEdge T710 (tested)
|
|
- Dell PowerEdge R710/R720/R730 (should work)
|
|
- Dell PowerEdge R810/R820/R910/R920 (should work)
|
|
- HPE servers with iLO (partial support)
|
|
|
|
## Quick Start
|
|
|
|
### Prerequisites
|
|
|
|
- Docker and Docker Compose installed
|
|
- IPMI enabled on your server(s) with network access
|
|
|
|
### Installation
|
|
|
|
1. Clone the repository:
|
|
```bash
|
|
git clone https://git.lemonlink.eu/impulsivefps/ipmi-fan-control.git
|
|
cd ipmi-fan-control
|
|
```
|
|
|
|
2. Copy the example environment file and edit it:
|
|
```bash
|
|
cp .env.example .env
|
|
# Edit .env and set a secure SECRET_KEY
|
|
```
|
|
|
|
3. Create the data directory:
|
|
```bash
|
|
mkdir -p data
|
|
```
|
|
|
|
4. Start the application:
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
5. Access the web interface at `http://your-server-ip:8000`
|
|
|
|
6. Complete the setup wizard to create your admin account
|
|
|
|
### First Time Setup
|
|
|
|
1. When you first access the web UI, you'll be guided through a setup wizard
|
|
2. Create an administrator account
|
|
3. Add your first server by providing:
|
|
- Server name
|
|
- IP address/hostname
|
|
- IPMI username and password
|
|
- Vendor (Dell, HPE, etc.)
|
|
|
|
## Usage
|
|
|
|
### Manual Fan Control
|
|
|
|
1. Go to a server's detail page
|
|
2. Click on the "Fan Control" tab
|
|
3. Enable "Manual Fan Control"
|
|
4. Use the slider to set the desired fan speed
|
|
5. Click "Apply" to send the command
|
|
|
|
### Automatic Fan Curves
|
|
|
|
1. Go to the "Fan Curves" page for your server
|
|
2. Create a new fan curve with temperature/speed points
|
|
3. Select the curve and click "Start Auto Control"
|
|
4. The system will automatically adjust fan speeds based on temperatures
|
|
|
|
### Panic Mode
|
|
|
|
Panic mode is enabled by default. If the application loses connection to a server and cannot retrieve sensor data for the configured timeout period (default: 60 seconds), it will automatically set all fans to 100% speed for safety.
|
|
|
|
## IPMI Commands Used
|
|
|
|
This application uses the following IPMI raw commands:
|
|
|
|
### Dell Servers
|
|
|
|
- **Enable Manual Control**: `raw 0x30 0x30 0x01 0x00`
|
|
- **Disable Manual Control**: `raw 0x30 0x30 0x01 0x01`
|
|
- **Set Fan Speed**: `raw 0x30 0x30 0x02 <fan_id> <speed_hex>`
|
|
- **Get 3rd Party PCIe Status**: `raw 0x30 0xce 0x01 0x16 0x05 0x00 0x00 0x00`
|
|
- **Enable 3rd Party PCIe Response**: `raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00`
|
|
- **Disable 3rd Party PCIe Response**: `raw 0x30 0xce 0x00 0x16 0x05 0x00 0x00 0x00 0x05 0x00 0x01 0x00 0x00`
|
|
|
|
### Standard IPMI
|
|
|
|
- **Get Temperatures**: `sdr type temperature`
|
|
- **Get All Sensors**: `sdr elist full`
|
|
- **Get Power Supply Status**: `sdr type 'Power Supply'`
|
|
- **Dell Power Monitor**: `delloem powermonitor`
|
|
|
|
## Fan Mapping
|
|
|
|
For Dell servers, the fan mapping is:
|
|
|
|
| IPMI ID | Physical Fan |
|
|
|---------|--------------|
|
|
| 0x00 | Fan 1 |
|
|
| 0x01 | Fan 2 |
|
|
| 0x02 | Fan 3 |
|
|
| 0x03 | Fan 4 |
|
|
| 0x04 | Fan 5 |
|
|
| 0x05 | Fan 6 |
|
|
| 0x06 | Fan 7 |
|
|
| 0xff | All Fans |
|
|
|
|
## Configuration
|
|
|
|
### Environment Variables
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `SECRET_KEY` | (required) | Secret key for JWT tokens |
|
|
| `DATA_DIR` | /app/data | Directory for persistent data |
|
|
| `PANIC_TIMEOUT_SECONDS` | 60 | Seconds before panic mode activates |
|
|
| `PANIC_FAN_SPEED` | 100 | Fan speed during panic mode (%) |
|
|
| `DATABASE_URL` | sqlite:///app/data/... | Database connection string |
|
|
| `DEBUG` | false | Enable debug mode |
|
|
|
|
### Docker Compose
|
|
|
|
```yaml
|
|
version: '3.8'
|
|
|
|
services:
|
|
ipmi-fan-control:
|
|
image: ipmi-fan-control:latest
|
|
container_name: ipmi-fan-control
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- SECRET_KEY=your-secure-secret-key
|
|
- PANIC_TIMEOUT_SECONDS=60
|
|
volumes:
|
|
- ./data:/app/data
|
|
```
|
|
|
|
## Building from Source
|
|
|
|
### Backend
|
|
|
|
```bash
|
|
cd backend
|
|
pip install -r requirements.txt
|
|
python -m uvicorn main:app --reload
|
|
```
|
|
|
|
### Frontend
|
|
|
|
```bash
|
|
cd frontend
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
## Development
|
|
|
|
The application consists of:
|
|
|
|
- **Backend**: Python FastAPI with SQLAlchemy ORM
|
|
- **Frontend**: React with TypeScript, Material-UI, and Recharts
|
|
- **Database**: SQLite (default) or PostgreSQL
|
|
- **IPMI**: Direct integration with ipmitool
|
|
|
|
## Security Considerations
|
|
|
|
1. **Change the default SECRET_KEY** in production
|
|
2. Use HTTPS when accessing over the internet
|
|
3. Place behind a reverse proxy (nginx, traefik) for SSL termination
|
|
4. Use strong passwords for the admin account
|
|
5. Server passwords are encrypted at rest using Fernet encryption
|
|
6. Regularly update the Docker image for security patches
|
|
|
|
## Troubleshooting
|
|
|
|
### Cannot connect to server
|
|
|
|
1. Verify IPMI is enabled in the server's BIOS/iDRAC settings
|
|
2. Check network connectivity: `ping <server-ip>`
|
|
3. Test IPMI manually: `ipmitool -I lanplus -H <ip> -U <user> -P <pass> mc info`
|
|
4. Check firewall rules allow IPMI traffic (port 623)
|
|
|
|
### Fan control not working
|
|
|
|
1. Ensure manual fan control is enabled first
|
|
2. Check that the server supports the IPMI raw commands
|
|
3. Verify you have admin/root IPMI privileges
|
|
4. Some servers require 3rd party PCIe card response to be disabled
|
|
|
|
### Container won't start
|
|
|
|
1. Check logs: `docker-compose logs -f`
|
|
2. Verify data directory has correct permissions
|
|
3. Ensure port 8000 is not already in use
|
|
|
|
## License
|
|
|
|
MIT License - See LICENSE file for details
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome! Please:
|
|
|
|
1. Fork the repository
|
|
2. Create a feature branch
|
|
3. Make your changes
|
|
4. Submit a pull request
|
|
|
|
## Support
|
|
|
|
For issues and feature requests, please use the GitHub issue tracker.
|
|
|
|
## Acknowledgments
|
|
|
|
- Dell for the IPMI command documentation
|
|
- The ipmitool project
|
|
- FastAPI and React communities
|