diff --git a/docs/FAQ.md b/docs/FAQ.md index 8efdfaaadd..5f5895e0bf 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -428,6 +428,24 @@ does not prove that every reading is fresh. Missing or unavailable is not zero. drawers across images, volumes, engine storage usage and networks display the same inline Docker stale-readings notice and freshness-aware status indicator until live reporting recovers. +- **Physical disks** (on Storage disk tables, linked storage-pool disk rows, and + **Physical Disks & SMART** cards in guest, machine, and host drawers) surface + source staleness when a host agent, Proxmox poller, or TrueNAS source stops + updating or hits a collection error. Clear stale disks switch from **Healthy** + or **Online** to amber **Stale**, leave the **Healthy** filter, join + **Attention** and **Warning**, and sort ahead of fresh healthy disks. Worse + verdicts (**Replace Now** and **Needs Attention**) stay visible with an inline + amber **Stale data** cue beneath the disk name (or beside the health label in + guest, machine, and host drawers). Stale temperatures and SSD **Life + remaining** percentages render in muted dotted-underline last-known styling + and never trigger a live **Running Hot** verdict. Physical disk search matches + `stale`, `stale data`, refresh age, and recorded source error text, and + expanding a stale disk shows an amber inline notice (`Stale data. Retained + last-known disk readings.` with the last refresh age and source error when + present, plus `Health, temperature, and SMART readings reflect the last report + received and may no longer be current.`), labels the health card **Last known + temperature**, and defers temperature and SMART history charts as last-known + values until live reporting recovers. Use the relevant checks for [stale TrueNAS data](TRUENAS.md#stale-truenas-data), [stale Kubernetes readings](KUBERNETES.md#stale-kubernetes-readings), diff --git a/docs/TRUENAS.md b/docs/TRUENAS.md index 42c5f2619e..be778ddf8b 100644 --- a/docs/TRUENAS.md +++ b/docs/TRUENAS.md @@ -188,7 +188,16 @@ while TrueNAS still reports the condition. use the saved per-disk temperature override, then the TrueNAS-wide default, then the inherited agent/by-type policy. An Off or disabled temperature policy leaves the reading visible but unjudged; a last known reading is never current -heat. A display mismatch is not proof that your saved rule failed. Compare the same disk, observation time and saved threshold with +heat. When TrueNAS polling goes stale or hits a collection error, clear physical +disks switch from **Healthy** to amber **Stale** (leaving the **Healthy** filter +and joining **Attention** and **Warning**), while **Replace Now** and **Needs +Attention** verdicts stay visible with an inline amber **Stale data** cue +beneath the disk name. Stale temperatures and SSD **Life remaining** values +render as muted last-known readings without triggering **Running Hot**, disk +search matches stale labels and source errors, and expanding the disk shows an +amber notice (`Stale data. Retained last-known disk readings.`) while deferring +temperature and SMART history charts as last-known values until live polling +recovers. A display mismatch is not proof that your saved rule failed. Compare the same disk, observation time and saved threshold with its existing TrueNAS reading and SMART state; do not raise thresholds, run new SMART tests, force a probe or restart merely to make the views agree. diff --git a/docs/UNIFIED_AGENT.md b/docs/UNIFIED_AGENT.md index 8eff8df2b6..55b02d77dd 100644 --- a/docs/UNIFIED_AGENT.md +++ b/docs/UNIFIED_AGENT.md @@ -907,6 +907,7 @@ The agent can report S.M.A.R.T. disk temperatures, health status, identity, and **Notes:** - Disks in standby mode are reported as such (no temperature) to avoid waking them - S.M.A.R.T. data is collected alongside other host metrics and can enrich the Physical Disks view with temperature, stable disk identity, power-on hours, SSD life, pending sectors, media errors, and related counters +- When a host agent stops updating or hits a collection error, Physical Disks (and **Physical Disks & SMART** cards inside guest, machine, and host drawers) switch clear disks from **Healthy** or **Online** to amber **Stale** (moving them out of **Healthy** into **Attention** and **Warning**), keep **Replace Now** and **Needs Attention** verdicts visible with an inline amber **Stale data** cue, style stale temperatures and SSD **Life remaining** as muted last-known values so they never trigger **Running Hot**, and display an inline `Stale data. Retained last-known disk readings.` notice while deferring temperature and SMART history charts until fresh agent reports arrive - If `smartctl` is not available, S.M.A.R.T. monitoring is silently skipped - **Disk exclusions** (`--disk-exclude` / `PULSE_DISK_EXCLUDE`) also apply to S.M.A.R.T. monitoring. Use patterns like `sda`, `/dev/sdb`, `nvme*`, or `*cache*` to exclude specific block devices. diff --git a/frontend-modern/public/docs/FAQ.md b/frontend-modern/public/docs/FAQ.md index 8efdfaaadd..5f5895e0bf 100644 --- a/frontend-modern/public/docs/FAQ.md +++ b/frontend-modern/public/docs/FAQ.md @@ -428,6 +428,24 @@ does not prove that every reading is fresh. Missing or unavailable is not zero. drawers across images, volumes, engine storage usage and networks display the same inline Docker stale-readings notice and freshness-aware status indicator until live reporting recovers. +- **Physical disks** (on Storage disk tables, linked storage-pool disk rows, and + **Physical Disks & SMART** cards in guest, machine, and host drawers) surface + source staleness when a host agent, Proxmox poller, or TrueNAS source stops + updating or hits a collection error. Clear stale disks switch from **Healthy** + or **Online** to amber **Stale**, leave the **Healthy** filter, join + **Attention** and **Warning**, and sort ahead of fresh healthy disks. Worse + verdicts (**Replace Now** and **Needs Attention**) stay visible with an inline + amber **Stale data** cue beneath the disk name (or beside the health label in + guest, machine, and host drawers). Stale temperatures and SSD **Life + remaining** percentages render in muted dotted-underline last-known styling + and never trigger a live **Running Hot** verdict. Physical disk search matches + `stale`, `stale data`, refresh age, and recorded source error text, and + expanding a stale disk shows an amber inline notice (`Stale data. Retained + last-known disk readings.` with the last refresh age and source error when + present, plus `Health, temperature, and SMART readings reflect the last report + received and may no longer be current.`), labels the health card **Last known + temperature**, and defers temperature and SMART history charts as last-known + values until live reporting recovers. Use the relevant checks for [stale TrueNAS data](TRUENAS.md#stale-truenas-data), [stale Kubernetes readings](KUBERNETES.md#stale-kubernetes-readings), diff --git a/frontend-modern/public/docs/TRUENAS.md b/frontend-modern/public/docs/TRUENAS.md index 42c5f2619e..be778ddf8b 100644 --- a/frontend-modern/public/docs/TRUENAS.md +++ b/frontend-modern/public/docs/TRUENAS.md @@ -188,7 +188,16 @@ while TrueNAS still reports the condition. use the saved per-disk temperature override, then the TrueNAS-wide default, then the inherited agent/by-type policy. An Off or disabled temperature policy leaves the reading visible but unjudged; a last known reading is never current -heat. A display mismatch is not proof that your saved rule failed. Compare the same disk, observation time and saved threshold with +heat. When TrueNAS polling goes stale or hits a collection error, clear physical +disks switch from **Healthy** to amber **Stale** (leaving the **Healthy** filter +and joining **Attention** and **Warning**), while **Replace Now** and **Needs +Attention** verdicts stay visible with an inline amber **Stale data** cue +beneath the disk name. Stale temperatures and SSD **Life remaining** values +render as muted last-known readings without triggering **Running Hot**, disk +search matches stale labels and source errors, and expanding the disk shows an +amber notice (`Stale data. Retained last-known disk readings.`) while deferring +temperature and SMART history charts as last-known values until live polling +recovers. A display mismatch is not proof that your saved rule failed. Compare the same disk, observation time and saved threshold with its existing TrueNAS reading and SMART state; do not raise thresholds, run new SMART tests, force a probe or restart merely to make the views agree. diff --git a/frontend-modern/public/docs/UNIFIED_AGENT.md b/frontend-modern/public/docs/UNIFIED_AGENT.md index 8eff8df2b6..55b02d77dd 100644 --- a/frontend-modern/public/docs/UNIFIED_AGENT.md +++ b/frontend-modern/public/docs/UNIFIED_AGENT.md @@ -907,6 +907,7 @@ The agent can report S.M.A.R.T. disk temperatures, health status, identity, and **Notes:** - Disks in standby mode are reported as such (no temperature) to avoid waking them - S.M.A.R.T. data is collected alongside other host metrics and can enrich the Physical Disks view with temperature, stable disk identity, power-on hours, SSD life, pending sectors, media errors, and related counters +- When a host agent stops updating or hits a collection error, Physical Disks (and **Physical Disks & SMART** cards inside guest, machine, and host drawers) switch clear disks from **Healthy** or **Online** to amber **Stale** (moving them out of **Healthy** into **Attention** and **Warning**), keep **Replace Now** and **Needs Attention** verdicts visible with an inline amber **Stale data** cue, style stale temperatures and SSD **Life remaining** as muted last-known values so they never trigger **Running Hot**, and display an inline `Stale data. Retained last-known disk readings.` notice while deferring temperature and SMART history charts until fresh agent reports arrive - If `smartctl` is not available, S.M.A.R.T. monitoring is silently skipped - **Disk exclusions** (`--disk-exclude` / `PULSE_DISK_EXCLUDE`) also apply to S.M.A.R.T. monitoring. Use patterns like `sda`, `/dev/sdb`, `nvme*`, or `*cache*` to exclude specific block devices. diff --git a/scripts/tests/test_stale_reading_help_docs.py b/scripts/tests/test_stale_reading_help_docs.py index b0ec699e1b..2ed6de9fae 100644 --- a/scripts/tests/test_stale_reading_help_docs.py +++ b/scripts/tests/test_stale_reading_help_docs.py @@ -626,6 +626,105 @@ class StaleReadingAndAgentHelpDocsTest(unittest.TestCase): self.assertIn("ReportEncodedBodyLimitBytes int64 = 2 * 1024 * 1024", report_limits) self.assertIn("ReportDecodedBodyLimitBytes int64 = 10 * 1024 * 1024", report_limits) + def test_help_documents_physical_disk_stale_readings_across_storage_and_drawers(self): + faq = doc_text("docs/FAQ.md") + faq_section = norm( + faq.split("### No data showing?\n", 1)[1].split("\n### ", 1)[0] + ) + for phrase in ( + "**Physical disks**", + "**Physical Disks & SMART** cards in guest, machine, and host drawers", + "switch from **Healthy** or **Online** to amber **Stale**", + "leave the **Healthy** filter, join **Attention** and **Warning**, and sort ahead of fresh healthy disks", + "Worse verdicts (**Replace Now** and **Needs Attention**) stay visible with an inline amber **Stale data** cue beneath the disk name", + "Stale temperatures and SSD **Life remaining** percentages render in muted dotted-underline last-known styling and never trigger a live **Running Hot** verdict", + "Physical disk search matches `stale`, `stale data`, refresh age, and recorded source error text", + "`Stale data. Retained last-known disk readings.`", + "`Health, temperature, and SMART readings reflect the last report received and may no longer be current.`", + "labels the health card **Last known temperature**, and defers temperature and SMART history charts as last-known values until live reporting recovers", + ): + with self.subTest(doc="FAQ.md", phrase=phrase): + self.assertIn(phrase, faq_section) + + truenas = doc_text("docs/TRUENAS.md") + truenas_disk = norm( + truenas.split("## Disk temperature and health\n", 1)[1].split( + "## Multiple TrueNAS Systems", 1 + )[0] + ) + for phrase in ( + "switch from **Healthy** to amber **Stale** (leaving the **Healthy** filter and joining **Attention** and **Warning**)", + "**Replace Now** and **Needs Attention** verdicts stay visible with an inline amber **Stale data** cue beneath the disk name", + "Stale temperatures and SSD **Life remaining** values render as muted last-known readings without triggering **Running Hot**", + "`Stale data. Retained last-known disk readings.`", + "deferring temperature and SMART history charts as last-known values until live polling recovers", + ): + with self.subTest(doc="TRUENAS.md", phrase=phrase): + self.assertIn(phrase, truenas_disk) + + unified = doc_text("docs/UNIFIED_AGENT.md") + smart_section = norm( + unified.split("## S.M.A.R.T. Disk Health\n", 1)[1].split( + "\n## Auto-Update", 1 + )[0] + ) + for phrase in ( + "**Physical Disks & SMART** cards inside guest, machine, and host drawers", + "switch clear disks from **Healthy** or **Online** to amber **Stale**", + "keep **Replace Now** and **Needs Attention** verdicts visible with an inline amber **Stale data** cue", + "style stale temperatures and SSD **Life remaining** as muted last-known values so they never trigger **Running Hot**", + "`Stale data. Retained last-known disk readings.`", + "deferring temperature and SMART history charts until fresh agent reports arrive", + ): + with self.subTest(doc="UNIFIED_AGENT.md", phrase=phrase): + self.assertIn(phrase, smart_section) + + disk_pres = doc_text("frontend-modern/src/features/storageBackups/diskPresentation.ts") + disk_temp = doc_text( + "frontend-modern/src/features/storageBackups/diskTemperaturePresentation.ts" + ) + disk_drawer = doc_text( + "frontend-modern/src/features/storageBackups/diskDrawerPresentation.ts" + ) + disk_list = doc_text("frontend-modern/src/components/Storage/DiskList.tsx") + disk_overview = doc_text("frontend-modern/src/components/Storage/DiskDrawerOverview.tsx") + guest_disks = doc_text("frontend-modern/src/components/Workloads/GuestPhysicalDisks.tsx") + pool_detail = doc_text( + "frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts" + ) + + for marker in ( + "export function extractPhysicalDiskFreshness(resource: Resource)", + "return `Retained last-known disk readings.${age}${error}`.trim();", + "disk.freshness === 'stale' ? 'stale stale data' : ''", + "label: 'Stale'", + "if (verdict.kind === 'attention' || disk.freshness === 'stale') return 'warning';", + "return disk.freshness === 'stale' ? 100 : 0;", + ): + self.assertIn(marker, disk_pres) + for marker in ( + "if (freshness === 'stale') return false;", + "if (!isPhysicalDiskTemperatureCurrent(disk.collection, disk.freshness)) return false;", + ): + self.assertIn(marker, disk_temp) + for marker in ( + "if (disk.freshness === 'stale') return {};", + "if (disk.freshness === 'stale') {", + "temperature.current ? 'Temperature' : 'Last known temperature'", + ): + self.assertIn(marker, disk_drawer) + self.assertIn("data-disk-stale-cue", disk_list) + self.assertIn('data-life-reading={isStale() ? \'last-known\' : \'current\'}', disk_list) + for marker in ( + 'data-testid="disk-drawer-stale-notice"', + 'Stale data.', + "Health, temperature, and", + "SMART readings reflect the last report received and may no longer be current.", + ): + self.assertIn(marker, disk_overview) + self.assertIn("data-disk-stale-cue", guest_disks) + self.assertIn("extractPhysicalDiskFreshness(disk)", pool_detail) + def test_shipped_public_docs_mirrors_match_byte_for_byte(self): for name in ( "AGENT_SECURITY.md",