Skip to content

Repository files navigation

PCMonitor

A local, real-time system monitor for Windows, built with .NET 10 / WPF. It shows CPU / RAM / per-disk / network / NPU / GPU0 / GPU1 utilization and temperatures on a single dark dashboard, plus network health (VPN detection, external IP + geolocation, host ping), persists every sample to SQLite, and includes basic report analytics.

繁體中文詳細說明請見下方 繁體中文 段落。

Features

  • Real-time dashboard (2 s refresh by default): CPU %, CPU temp (package + per-core), RAM, per-disk capacity + activity, per-NIC throughput, NPU, GPU0/GPU1 load + temp, NVMe/SSD temps — each metric with a live sparkline.
  • Traffic-light status colors (green / amber / red / grey) on a dark, near-black theme; the accent color is reserved for sparklines.
  • Network health: VPN connection detection, external IP + geolocation (ip-api.com), configurable host ping (latency + rolling uptime %).
  • Persistence: every sample written to SQLite (WAL, single writer, batched flush), 7-day retention by default with periodic purge + incremental vacuum.
  • Reports: pick a metric + range → server-side bucketed avg/max/min chart + data grid + CSV export.
  • Bilingual Traditional Chinese / English with runtime switching; minimizes to the system tray.
  • Standalone: no dependency on any external monitoring tool at runtime.

Requirements

  • Windows 10 / 11, .NET 10 runtime (or run the published framework-dependent build with the runtime installed).
  • Administrator rights are required to read CPU / GPU / motherboard temperatures via LibreHardwareMonitor's ring0 driver (a UAC prompt appears on launch). Without elevation, those temps show N/A while every other metric keeps working (graceful degradation).

Known hardware limitations (by design, not bugs)

Temperatures depend on what the underlying library can read on a given machine:

  • CPU package / per-core temp: on some platforms — e.g. Intel Arrow Lake (Core Ultra 200 HX-series) — LibreHardwareMonitor 0.9.6 (and 0.9.7-pre) exposes the temperature sensor objects but never obtains a value, so they read N/A. This was confirmed by reflection: the values are genuinely absent internally, not merely hidden.
  • Motherboard / chipset temp: often N/A when the board's Super I/O / Embedded Controller is locked by the BIOS (common on laptops).
  • Intel integrated-GPU temp: frequently unavailable (load still reads correctly).
  • GPU (NVIDIA/AMD) temps, NVMe/SSD temps, and all utilization / network / ping / IP metrics work normally.

Build & run

dotnet build -c Debug
dotnet run -c Debug                              # UAC prompt (admin)
dotnet publish -c Release -r win-x64 --self-contained false -o publish

run-elevated.cmd self-elevates and runs --dump--lhm → launches the dashboard, useful for a one-shot verification of temps and the sensor map.

Diagnostic flags

PCMonitor.exe --dump                # one-shot snapshot to console + last-dump.txt (no UI)
PCMonitor.exe --shot out.png        # sample 6 s then screenshot the dashboard and exit
PCMonitor.exe --lhm                 # list all LHM hardware/sensors (incl. EC probe) -> lhm-sensors.txt
PCMonitor.exe --dbcount             # print DB sample count + first/last timestamp
PCMonitor.exe --seedoutage          # write 2 demo outage rows (verify the History window)
PCMonitor.exe --dbcountoutages      # print outage row count
PCMonitor.exe --lang en             # force language (auto/zh/en)

Data (settings + SQLite DB + logs) lives in %LocalAppData%\PCMonitor\.

Connectivity history

Unreachability is recorded as outage events: a host going down (after a configurable number of consecutive ping failures, default 3) opens a row with DownAt; recovering closes it with RecoveredAt + duration. Open the History window from the toolbar or the Connectivity card (its button also shows a 24 h outage count). Retention is configurable (default 30 days).

License

MIT — see LICENSE. Copyright (c) 2026 Henry Jia.

Third-party notices

This project uses the following third-party components:

Contributing

Issues and pull requests are welcome. Please keep the project standalone (no runtime dependency on external monitoring tools), and note that any change to hardware-sensor reading touches ring0 / driver code paths — test carefully and avoid guessing undocumented MSR/register layouts.


繁體中文

本機即時系統監控工具(.NET 10 / WPF)。集中顯示 CPU / RAM / 各磁碟 / 網路 / NPU / GPU0 / GPU1 的占用率與溫度,附網路健康資訊(VPN、外部 IP + 地理位置、網站 ping),所有樣本落 SQLite,內建基本報表分析。獨立運行,運行時不依賴任何外部監控工具。

功能

  • 即時儀表板(預設 2 秒刷新):CPU%、CPU 溫度(封裝 + 逐核)、RAM、各磁碟容量與活動度、各網路卡吞吐、GPU0/GPU1 負載與溫度、NPU、NVMe/SSD 溫度,每個指標含即時 sparkline。
  • 交通燈狀態色(綠 / 琥珀 / 紅 / 灰)於深色近黑主題;強調色僅保留給 sparkline。
  • 網路狀態:VPN 連線偵測、外部 IP + 地理位置(ip-api.com)、預設主機 ping 延遲與可達率。
  • 持久化:所有樣本寫入 SQLite(WAL、單寫者、批次),預設保留 7 天,定期 purge + incremental vacuum。
  • 報表:選 metric + 範圍 → server-side 分桶 avg/max/min 圖表 + 資料表 + CSV 匯出。
  • 雙語(繁中 / English,可即時切換)、收合系統匣常駐。

為什麼需要系統管理員權限

CPU 溫度、主機板溫度、部分感測器需透過 LibreHardwareMonitor 的 ring0 核心驅動(WinRing0 類)讀取硬體暫存器,只有系統管理員權限能載入該驅動。因此程式以 requireAdministrator 啟動,每次執行會跳 UAC 提示。

  • 未獲管理員權限時,溫度類讀數會顯示 N/A,但 CPU%/RAM/磁碟/網路/GPU 負載(經 NVAPI)/ping/IP 仍可正常運作(graceful degradation)。
  • anti-cheat 警告:WinRing0 類驅動在部分反作弊軟體(Vanguard、FACEIT 等)的封鎖清單上。若執行本程式時啟動某些遊戲,遊戲可能拒絕啟動。結束本程式(系統匣 → 退出)即卸載驅動。
  • 部分主機板的 EC/SMBus 探測可能讓驅動載入較慢;本程式以背景緒 + 15 秒 watchdog 處理,逾時僅溫度顯示 N/A,不影響其餘監控與 UI。

已知硬體限制(設計如此,非 bug)

溫度取決於底層函式庫在該機器能讀到什麼:

  • CPU 封裝 / 逐核溫度:部分平台(如 Intel Arrow Lake / Core Ultra 200 HX 系列)在 LibreHardwareMonitor 0.9.6(與 0.9.7-pre)下,溫度感測器物件存在但從未取得值,故顯示 N/A。經反射探查確認:值在內部確實不存在,非僅未暴露。
  • 主機板 / 晶片組溫度:當 Super I/O / EC 被 BIOS 鎖定時常為 N/A(筆電常見)。
  • Intel 內顯溫度:常不可得(負載仍可讀)。
  • GPU(NVIDIA/AMD)溫度、NVMe/SSD 溫度,以及所有占用率 / 網路 / ping / IP 指標皆正常。

建置 / 執行

dotnet build -c Debug
dotnet run -c Debug                 # 會跳 UAC(管理員)
dotnet publish -c Release -r win-x64 --self-contained false -o publish

run-elevated.cmd:雙擊自動以管理員重啟自身,依序跑 --dump--lhm → 啟動儀表板,方便一次驗證溫度與感測器地圖。

除錯旗標

PCMonitor.exe --dump                # 取樣一次輸出快照到控制台 + last-dump.txt(不進 UI)
PCMonitor.exe --shot out.png        # 取樣 6 秒後截圖儀表板再退出
PCMonitor.exe --lhm                 # 列出 LHM 全部硬體/感測器(含 EC 探測)→ lhm-sensors.txt
PCMonitor.exe --dbcount             # 讀取 DB 樣本筆數與首末時間戳
PCMonitor.exe --seedoutage          # 寫 2 筆示範 outage(驗證歷史視窗)
PCMonitor.exe --dbcountoutages      # 讀取 outage 筆數
PCMonitor.exe --lang en             # 強制語言(auto/zh/en)

連線歷史

不可達以 outage 事件 記錄:主機由通變不通(連續 ping 失敗達門檻,預設 3 次)開一條記 DownAt;恢復則補 RecoveredAt + 時長。從工具列或「連線監測」卡開歷史視窗(卡上按鈕亦顯示近 24h outage 數)。保留天數可調(預設 30 天)。

診斷:用 --lhm 可列出 LHM 看到的全部硬體/感測器(含 Embedded Controller 探測),判斷某溫度到底是「感測器不存在」還是「存在但讀不到值」。 備註:經反射探查確認,LHM 0.9.6 在此機內部也沒有任何隱藏的 CPU/內顯溫度值(CPU 溫度 sensor 物件存在但從未成功採樣;內顯連溫度 sensor 都未建立),故反射路不可行;補回需 LHM 上游支援 Arrow Lake。

資料位置

全部在 %LocalAppData%\PCMonitor\C:\Users\<你>\AppData\Local\PCMonitor\):

  • settings.json — 設定
  • pcmonitor.db(+ -wal / -shm)— SQLite 時間序列
  • error.log — 非致命例外記錄

授權

MIT — 見 LICENSE。Copyright (c) 2026 Henry Jia。

第三方授權

貢獻

歡迎 issue 與 PR。請保持專案獨立運行(運行時不依賴外部監控工具);任何更動硬體感測器讀取的改動都會碰到 ring0 / 驅動路徑,務必謹慎測試、切勿猜測未公開的 MSR/暫存器佈局。

About

Real-time Windows system monitor (CPU/RAM/disk/net/NPU/GPU temps, network health, SQLite, reports) — .NET 10 / WPF

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages