USB-AIO für automatische Geräteprüfung
Some checks failed
Tests / test (push) Has been cancelled

This commit is contained in:
2026-10-14 20:14:36 +02:00
commit 81f06cf6b4
40 changed files with 9956 additions and 0 deletions

10
scripts/db-view.py Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env python3
import pathlib, sqlite3, sys
p=pathlib.Path(sys.argv[1])
if not p.is_file():
print('No database scans yet.'); sys.exit(0)
with sqlite3.connect(f'file:{p}?mode=ro', uri=True) as db:
print('Total scans:', db.execute('SELECT count(*) FROM scans').fetchone()[0])
print('Unique assets:', db.execute('SELECT count(DISTINCT asset_id) FROM scans').fetchone()[0])
for asset, model, gate, timestamp in db.execute('SELECT asset_id, model, health_gate, scanned_at_unix FROM scans ORDER BY scan_id DESC LIMIT 15'):
print(f'{asset:14} | {(model or "unknown")[:28]:28} | {gate or "UNKNOWN"} | {timestamp}')