Add Health Check Endpoint #21

Open
opened 2026-02-02 14:51:42 -05:00 by jared · 0 comments
Owner

For monitoring the monitor, add a simple HTTP health endpoint:

def start_health_server(self):
"""Simple HTTP server for health checks."""
from http.server import HTTPServer, BaseHTTPRequestHandler

class HealthHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == '/health':
            self.send_response(200)
            self.end_headers()
            self.wfile.write(b'OK')

server = HTTPServer(('localhost', 9102), HealthHandler)
import threading
threading.Thread(target=server.serve_forever, daemon=True).start()
For monitoring the monitor, add a simple HTTP health endpoint: def start_health_server(self): """Simple HTTP server for health checks.""" from http.server import HTTPServer, BaseHTTPRequestHandler class HealthHandler(BaseHTTPRequestHandler): def do_GET(self): if self.path == '/health': self.send_response(200) self.end_headers() self.wfile.write(b'OK') server = HTTPServer(('localhost', 9102), HealthHandler) import threading threading.Thread(target=server.serve_forever, daemon=True).start()
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/hwmonDaemon#21