feat: add drive temperature monitoring with async updates and multi-pattern SMART parsing

Add smart_temperature() function with smartctl -A command execution, fallback to -d sat mode, and regex patterns for Temperature_Celsius/Airflow_Temperature_Cel/Drive_Temperature/Current Drive Temperature attributes plus Temperature: field parsing with 1-3 digit capture and °C formatting. Add temperature_futures dict with service_check_executor.submit() calls for parallel temperature reads alongside smart_futures. Add disk["
This commit is contained in:
2026-08-16 20:07:19 +02:00
parent 71752483f6
commit 310b36317e
2 changed files with 25 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
<!doctype html>
<script>
document.addEventListener('DOMContentLoaded',()=>{const updateTemperatures=async()=>{const container=document.querySelector('#raidDisks');if(!container)return;try{const data=await (await fetch('/api/datastore')).json();const disks=data.raid?.devices||[];container.querySelectorAll('.raid-disk').forEach(row=>{const device=row.querySelector('strong')?.textContent.trim();const disk=disks.find(item=>item.device===device);if(!disk)return;let node=row.querySelector('.raid-temperature');if(!node){node=document.createElement('small');node.className='raid-temperature';const smart=row.querySelector('.raid-smart');if(smart)smart.after(node);else row.querySelector('div')?.append(node)}node.textContent=`Temperatur: ${disk.temperature||'Nicht verfügbar'}`})}catch(error){}};updateTemperatures();setInterval(updateTemperatures,5000)});
</script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/sw.js?v=4', {scope: '/'}).catch(function () {});