Page 1 of 1

Windows node exporter install error

Posted: 2026 Aug 04, 10:12
by Mihai
Service failed to start during MSI install. Fix:

Click Ignore to finish install.
Check port conflict:

Code: Select all

netstat -ano | findstr :9182
Check service log: Event Viewer → Windows Logs → System, filter for windows_exporter
Verify config file syntax if using --config.file (YAML) or collector flags — bad flags in service args cause immediate exit.
Check service binary path/args:

Code: Select all

sc qc windows_exporter
Try manual start for real error:

Code: Select all

"C:\Program Files\windows_exporter\windows_exporter.exe" --config.file="C:\Program Files\windows_exporter\config.yml"
Ensure install run as Administrator (elevated cmd/powershell), not just admin user without elevation.
If installed with custom collectors (--collectors.enabled=...), invalid collector name = crash on start.


WMI Performance Adapter (WmiApSrv) is disabled. Enable it:

Code: Select all

sc config wmiapsrv start= demand
sc start wmiapsrv
Then restart windows_exporter:

Code: Select all

sc config windows_exporter depend= wmiapsrv
net start windows_exporter
Check dependent adapter status after:

Code: Select all

sc qc wmiapsrv
Default port 9182:

Code: Select all

http://localhost:9182/metrics
From another host:

Code: Select all

http://<hostname_or_ip>:9182/metrics
Check listener:

Code: Select all

netstat -ano | findstr :9182
Firewall rule if remote access fails:

Code: Select all

netsh advfirewall firewall add rule name="windows_exporter" dir=in action=allow protocol=TCP localport=9182
windows exporter config.yaml

Code: Select all

collectors:
  enabled: cpu,logical_disk,net,os,service,system,memory,tcp,textfile,process,diskdrive,thermalzone,time,cpu_info,scheduled_task,pagefile

collector:
  service:
    include: windows_exporter

log:
  level: warn

Debugs:

Code: Select all

C:\Windows\System32>sc start windows_exporter
[SC] StartService FAILED 1068:
The dependency service or group failed to start.
WmiApSrv dependency stopped (disabled or crashed). Check and restart it:

Code: Select all

sc query wmiapsrv
If stopped/disabled:

Code: Select all

sc config wmiapsrv start= demand
Then:

Code: Select all

sc start windows_exporter
If wmiapsrv fails to start, check Event Viewer → System log for a fresh error on it, or run:

Code: Select all

winmgmt /resyncperf
lodctr /r
Set startup type to Automatic:

Code: Select all

sc config wmiapsrv start= auto
Recommended: delayed-auto to avoid boot-time race conditions with WMI:

Code: Select all

sc config wmiapsrv start= delayed-auto
Start it now:

Code: Select all

sc start wmiapsrv
Verify:

Code: Select all

sc qc wmiapsrv
Add commands to run at startup:
Open Task Scheduler and select Create Basic Task.
Name the task and set the trigger to When the computer starts.
For the action, select Start a program.
In the "Program/script" field, enter cmd.exe.
In the "Add arguments" field, enter /k your_command_here (or /c to close the window after running).
Note: Check Run with highest privileges if the command requires admin rights.

Command Line Alternative: You can also create a scheduled task programmatically using:

Code: Select all

schtasks.exe /create /tn "StartupTask" /ru SYSTEM /Sc ONSTART /tr "C:\path\to\script.cmd" /RL HIGHEST
Command Breakdown
/create: Instructs schtasks.exe to create a new scheduled task.
/tn "StartupTask": Specifies the Task Name. This is the unique identifier for the task in the Task Scheduler library.
/ru SYSTEM: Defines the Run User account. Setting this to SYSTEM executes the task under the local System account, which has higher privileges than standard administrator accounts and is used by the OS itself.
/Sc ONSTART: Sets the Schedule type to ONSTART. This triggers the task immediately after the Windows kernel loads, before any user logs in.
/tr "C:\path\to\script.cmd": Specifies the Task Run action. This is the full path to the executable, batch file, or script that the task will execute.
/RL HIGHEST: Sets the Run Level to HIGHEST. This ensures the task runs with elevated privileges (equivalent to checking "Run with highest privileges" in the GUI), which is often required for system-level modifications.

Key Considerations
Administrative Rights: You must run the command prompt as Administrator to execute this command successfully; otherwise, you will receive an "Access is denied" error.
No Password Needed: When using /ru SYSTEM, you do not need to provide a password (/rp), as the System account does not use one.
Execution Context: Because this runs as SYSTEM at boot, it cannot interact with the user's desktop (no visible windows) and runs before user-specific environment variables are loaded.