Install Windows monitoring
Add a Windows desktop to folly's Prometheus, install or update its monitoring agents, and find why it stopped reporting.
Use this runbook to make a Windows desktop report to folly's Prometheus and VictoriaLogs, to update its agents, or to find why it stopped reporting. apps/lookout/windows/Install-Monitoring.ps1 installs three agents from downloads pinned by SHA256. Lookout is the app that keeps them installed on a desktop that runs it, such as tallboy; Install Lookout adds it to a desktop.
Before you start#
- You need an administrator account on the desktop with PowerShell 7 and git, from Install a Windows desktop.
- You need a full checkout on a Linux machine, such as the WSL distro, and SSH access to a lab host, such as spore.
- The desktop must be on a network in the Internal firewall zone, such as Management or
future.
<host> is the desktop name. <HOST> is <host> in upper case, and <HOST>_IP is its key in clusters/folly/config/anchor-topology.json.
| Agent | Port | Supplies | Runs as |
|---|---|---|---|
windows_exporter | 9182 | System metrics and GPU load | Service |
| OhmGraphite | 4445 | Sensors, from LibreHardwareMonitor | Service, as LocalSystem |
| Vector | None | System and Application event logs | Scheduled task, as LocalSystem |
Add a desktop to Prometheus#
Under
desktopsinterraform/network/unifi/folly/clients.yaml, add<host>with itsmacand itsip, the host part of its address.Add
<HOST>_IPtoclusters/folly/config/anchor-topology.json.Add
<host>tolocal.windows_hostsinterraform/network/unifi/folly/windows-hosts.tf. If the desktop is onfuture, copy thetallboyentry. If it is on Management, copy theatomicentry.Add an endpoint with
${<HOST>_IP}andnodeName: <host>to the EndpointSlice inclusters/folly/monitoring/windows-exporters.yaml.Apply the change through a pull request. See Apply an OpenTofu change.
Result: The Atlantis plan creates
unifi_client.windows_hosts["<host>"].
Install or update the agents#
On the desktop, open PowerShell 7 as administrator.
Check out the installer, or update its checkout. The checkout holds only
apps/lookout/windows.$infra = "$HOME\src\github.com\jonpulsifer\infra" if (-not (Test-Path $infra)) { git clone --filter=blob:none --sparse https://github.com/jonpulsifer/infra $infra } cd $infra git sparse-checkout set apps/lookout/windows git pull --ff-onlyResult:
apps\lookout\windows\Install-Monitoring.ps1exists.Run the installer. To leave out the event logs, add
-SkipVector..\apps\lookout\windows\Install-Monitoring.ps1Result: The last line is
running Event Log shipping to VictoriaLogs, or==> Vector skippedwith-SkipVector.
Change an agent version#
On a Linux machine, get the SHA256 of the new release file,
<url>.curl -sL <url> | sha256sumResult: The hash, then
-.In
Install-Monitoring.ps1, change the<Agent>Version,<Agent>Urland<Agent>Sha256parameters together.<Agent>isExporter,OhmorVector.Merge the change.
Do Install or update the agents on each desktop.
Install Lookout#
Lookout replaces step 4 of Install or update the agents on a desktop that runs it.
Download
Lookout.msifrom the latestlookout-v<version>release of the repository, or from thelookout-msiartifact of alookoutworkflow run.On the desktop, run the installer. Approve the administrator prompt. If SmartScreen stops it, choose More info, then Run anyway.
msiexec /i .\Lookout.msiResult:
Lookoutis listed in Settings under Apps, and the service runs.Get-Service LookoutOpen Lookout from the Start menu once. It starts by itself at the next logon.
Result: The tray icon appears, and turns green once the three agents are installed.
Do Check a desktop. The agent's own metrics are there too.
ssh spore.lolwtf.ca "curl -s http://<ip>:9182/metrics" | grep '^lookout_'Result:
lookout_last_sync_success 1andlookout_component_current{component="..."} 1for each ofwindows_exporter,ohmgraphiteandvector.
Check a desktop#
note
A WSL distro in mirrored networking mode cannot reach the LAN address of its own desktop.
In the full checkout, read the desktop address,
<ip>.jq -r .data.<HOST>_IP clusters/folly/config/anchor-topology.jsonResult: The desktop address.
Read the status of
windows_exporterfrom a lab host.ssh spore.lolwtf.ca "curl -s -o /dev/null -w '%{http_code}\n' http://<ip>:9182/metrics"Result:
200, or000if the desktop is off.Read the collector status.
ssh spore.lolwtf.ca "curl -s http://<ip>:9182/metrics" | grep '^windows_exporter_collector_success'Result: Each collector has the value
1.Count the OhmGraphite metrics.
ssh spore.lolwtf.ca "curl -s http://<ip>:4445/metrics" | grep -c '^ohm_'Result: A number larger than
0.Read the Prometheus targets of
<host>.curl -s -G https://prom.lolwtf.ca/api/v1/query --data-urlencode 'query=up{job="windows-exporter",instance="<host>"}' \ | jq -r '.data.result[] | "\(.metric.endpoint) \(.value[1])"'Result:
http-metrics 1andsensors 1.In Grafana, query the VictoriaLogs data source with
{job="windows-eventlog", host="<host>"}.Result: The event log lines of
<host>.
Check Memory Integrity#
Memory Integrity and the vulnerable driver blocklist are Windows security settings. When either one is on, Windows blocks the LibreHardwareMonitor driver. The desktop then has no CPU temperature or fan speed, so WindowsCpuTempHigh and WindowsFanStopped cannot fire. If only those sensors are missing, do this procedure.
On the desktop, open PowerShell 7.
Read the security services that run.
(Get-CimInstance -Namespace root\Microsoft\Windows\DeviceGuard -ClassName Win32_DeviceGuard).SecurityServicesRunningResult: The list includes
2if Memory Integrity is on.Read the vulnerable driver blocklist setting.
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\CI\Config -Name VulnerableDriverBlocklistEnableResult:
VulnerableDriverBlocklistEnableis1if the blocklist is on.If either setting is on, accept the missing sensors.
If something goes wrong#
| Symptom | Cause | Action |
|---|---|---|
WindowsAgentDown fires. | One agent stopped, and the desktop is on. | Do Check a desktop, then Install or update the agents. |
WindowsDesktopUnseen fires. | The desktop has another address, or no agents. | Do step 2 of Check a desktop. |
Step 2 of Check a desktop prints 000 while Mullvad VPN is connected. | Mullvad drops LAN traffic while Local network sharing is off. | On the desktop, run mullvad lan set allow. |
WindowsCollectorFailing fires. | The performance counter registry is damaged. | As administrator, run lodctr /R. Run Restart-Service windows_exporter. |
Step 2 of Check a desktop prints 000, and the desktop is on. | The desktop has another address, or it is outside the Internal zone. | Find the desktop with Inspect the UniFi network. |
The installer stops with Hash mismatch. | The download is not the pinned file. | Make sure the <Agent>Url and <Agent>Sha256 parameters name the same release. |
Step 4 of Check a desktop prints 0. | The OhmGraphite service stopped, or it does not run as LocalSystem. | As administrator, run sc.exe config OhmGraphite obj= LocalSystem. Run Restart-Service OhmGraphite. |
| GPU temperature is present, and GPU load is missing. | The gpu collector is off. | Run the installer again. |
| Step 6 of Check a desktop shows no lines. | The Vector task stopped, or vector.yaml has another endpoint. | Run the installer again. |
The installer stops with A newer Lookout is installed. | The MSI is older than the installed one. | Uninstall Lookout from Settings, then do Install Lookout again. |
LookoutStale, LookoutComponentDrifted or LookoutComponentUnhealthy fires. | The Lookout service is stopped, paused, or an agent fails to install. | On the desktop, open the Application event log and filter on source Lookout. Choose Sync now in the tray. |
Related#
Linked from 6
- LookoutA Windows app, installed from an MSI, whose service keeps the monitoring agents on a Windows desktop at the versions git declares and reports its own health to folly. tallboy runs it.
- atomicA Windows desktop at folly on the future network that Prometheus on folly cannot scrape.
- tallboyThe owner's Windows 11 desktop at folly on the future network, which sends metrics and event logs to folly.
- ObservabilityThe metrics, logs, traces, dashboards and alerts on each Kubernetes cluster, the hosts and Windows desktops they watch, and the daily k6 check.
- RunbooksStep-by-step procedures for the hosts, clusters, network, secrets and apps, grouped by area.
- Install a Windows desktopInstall the owner's Windows configuration on a desktop with one PowerShell script, update it, add or replace the NixOS WSL distro, and test a change to the Windows dotfiles.