これが実現できる。
HWiNFO だと期待した形で情報が取れなかったので、OhmGraphite を使うことにした。
構成としては以下でやっていく。すべてローカルで動かし、Windowsサービス化する。
- OhmGraphite でリソース情報取得
- Prometheus がメトリクス集積
- WinSW でサービス化
- Grafana で可視化
から最新版をダウンロードして適当な場所に展開する。今回は C:\OhmGraphite に展開した。
記述時点のバージョン v0.36.0 では Pown.IO のインストールが必要なのでそれもやっておく。
設定 c:\OhmGraphite\OhmGraphite.exe.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="type" value="prometheus" />
<add key="prometheus_port" value="4445" />
<add key="prometheus_host" value="localhost" />
</appSettings>
</configuration>hostとしてバインドするのはあくまでlocalhostとしておく。今回はすべてのプロセスがlocalhost上で動作する前提で進めるので。
PowerShell:
PS C:\OhmGraphite> .\OhmGraphite.exe install
[SC] CreateService SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
PS C:\OhmGraphite> .\OhmGraphite.exe start
OhmGraphite started
http://localhost:4445/metrics でPrometheus向けのメトリクスが見えることを確認する。
から最新版をダウンロードして適当な場所に展開する。今回は C:\Prometheus に展開した。
記述時点のLTSバージョンは3.5.0。
Prometheusの設定ファイル C:\Prometheus\prometheus.yml:
global:
scrape_interval: 30s
scrape_configs:
- job_name: 'ohmgraphite'
static_configs:
- targets: ['localhost:4445']prometheus.exeをダブルクリックして動作確認をする。http://localhost:9090/targets で "ohmgraphite" ジョブが UP になっていることを確認する。
http://localhost:9090/query?g0.expr=ohm_cpu_celsius&g0.tab=graph などでメトリクスが取得できることを確認する。これはCPU温度を表すグラフ。
問題なさそうならCtrl+CでPrometheusを停止する。
サービス化のための設定ファイル C:\Prometheus\prometheus-service.xml:
<!--
WinSW configuration file
https://github.com/winsw/winsw
-->
<service>
<id>Prometheus</id>
<name>Prometheus</name>
<executable>prometheus.exe</executable>
<arguments>
--web.listen-address=localhost:9090
--storage.tsdb.retention.time=30d
--storage.tsdb.retention.size=1GB
</arguments>
<workingdirectory>%BASE%</workingdirectory>
<depend>Tcpip</depend>
<depend>Eventlog</depend>
<log mode="roll-by-size" />
</service>WinSWをダウンロードして、実行ファイルを C:\Prometheus\prometheus-service.exe と名前変更して配置し、下記実行する。
PS C:\Prometheus> .\prometheus-service.exe install
2025-11-08 16:22:54,847 INFO - Installing service 'Prometheus (Prometheus)'...
2025-11-08 16:22:54,879 INFO - Service 'Prometheus (Prometheus)' was installed successfully.
PS C:\Prometheus> .\prometheus-service.exe start
2025-11-08 16:33:15,559 INFO - Starting service 'Prometheus (Prometheus)'...
2025-11-08 16:33:16,013 INFO - Service 'Prometheus (Prometheus)' started successfully.
http://localhost:9090/targets で先ほど同様 "ohmgraphite" ジョブが UP になっていることを確認する。
からインストーラーをダウンロードしてインストールする。インストーラーを実行するとサービス化も自動でやってくれる。 ほか同様の手順でWinSWでサービス化してインストールする選択肢もあるが不要ならそれが一番なのでインストーラーを使う。 記述時点のバージョンは12.2.1。
設定ファイル C:\Program Files\GrafanaLabs\grafana\conf\custom.ini:
[server]
http_addr = 127.0.0.1TODO: 匿名アクセス設定してもよさそう
サービスを再起動する。
http://localhost:3000/ にアクセスして admin/admin でログインする。パスワード変更を促されるけどスキップ。
左カラムから Connections → "Add new Connection" でPrometheusを探して下記のように入力する。
- Name: Local Prometheus
- Prometheus server URL *: http://localhost:9090
- Scrape interval: 30s
ページ下部の "Save & Test" をクリックして動作確認。
左カラムから Dashboards → "Import" をクリックする。 Dashboard URL には https://grafana.com/grafana/dashboards/11587-ohm-windows-desktop/ を使う。 これは OhmGraphite の README に載っているダッシュボード。
Load を押し、Prometheus の項目に先ほど作成した "Local Prometheus" を選択して "Import" をクリックする。

