docs(bitacoras): Registro de Telemetría y estado de espera de SQL Setup

This commit is contained in:
Ricardo Monla
2026-02-26 10:34:10 -03:00
parent 33424d50ba
commit 9236f775a5
3 changed files with 73 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import http.server
import socketserver
import urllib.parse
from datetime import datetime
PORT = 8000
class CustomHandler(http.server.SimpleHTTPRequestHandler):
def do_POST(self):
content_length = int(self.headers.get('Content-Length', 0))
post_data = self.rfile.read(content_length).decode('utf-8')
parsed = urllib.parse.parse_qs(post_data)
msg = parsed.get('msg', [''])[0]
if msg:
with open('sql-install-telemetry.log', 'a') as f:
f.write(f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] {msg}\n")
# Print to standard output so I can read it with command_status
print(f"DB01 TELEMETRY: {msg}", flush=True)
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write(b"OK")
socketserver.TCPServer.allow_reuse_address = True
with socketserver.TCPServer(("", PORT), CustomHandler) as httpd:
print(f"Logging server listening intensely on port {PORT}...", flush=True)
httpd.serve_forever()