Initial Release

This commit is contained in:
Shikoro 2025-06-01 15:36:58 +02:00
commit 3decb801f2
4 changed files with 40 additions and 0 deletions

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM python:3.11-slim
WORKDIR /app
# Install Flask
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY app.py .
# Expose port
EXPOSE 8000
# Run the Flask app
CMD ["python", "app.py"]

23
app.py Normal file
View File

@ -0,0 +1,23 @@
from flask import Flask, Response
import re
app = Flask(__name__)
HEALTHY_PATTERN = re.compile(r'\[UU\]')
@app.route('/')
def check_raid():
try:
with open('/proc_host/mdstat', 'r') as f:
mdstat = f.read()
if HEALTHY_PATTERN.search(mdstat):
return Response("RAID OK", status=200)
else:
return Response("RAID DEGRADED", status=500)
except Exception as e:
return Response(f"Error checking RAID status: {str(e)}", status=500)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)

BIN
raidmonitor.tar Normal file

Binary file not shown.

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
flask