Hello,
I ran the following command on Windows OS:
windows_exporter.exe --collectors.enabled="cpu,cpu_info,cs,memory,logon,physical_disk,net,os,service,system,textfile,thermalzone,tcp,udp,license"
But I got the following error:
time=2024-12-28T10:13:12.702Z level=WARN source=os.go:108 msg="The os collect holds a number of deprecated metrics and will be removed mid 2025. See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information." collector=os
time=2024-12-28T10:13:12.710Z level=INFO source=textfile.go:108 msg="textfile directories: C:\\Program Files\\windows_exporter\\textfile_inputs" collector=textfile
time=2024-12-28T10:13:12.712Z level=WARN source=cs.go:75 msg="The cs collector is deprecated and will be removed in a future release. Logical processors has been moved to cpu_info collector. Physical memory has been moved to memory collector. Hostname has been moved to os collector."
time=2024-12-28T10:13:13.222Z level=INFO source=main.go:311 msg="Running as DESKTOP-1PNH21K\\Grafana"
time=2024-12-28T10:13:13.224Z level=INFO source=main.go:228 msg="Enabled collectors: cpu, cpu_info, cs, memory, logon, physical_disk, net, os, service, system, textfile, thermalzone, tcp, udp, license"
time=2024-12-28T10:13:13.226Z level=INFO source=main.go:246 msg="starting windows_exporter in 542.3953ms" version=0.30.0-rc.4 branch=HEAD revision=78386557d4dcb168b82e87084db8faf04dacdd72 goversion=go1.23.4 builddate=20241222-13:19:26 maxprocs=3
time=2024-12-28T10:13:13.227Z level=ERROR source=main.go:283 msg="Failed to start windows_exporter" err="listen tcp :9182: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."
Can’t windows_exporter parameters be changed?
Thank you.
Hi,
It seems like the exporter tries to bind to the port that is already in use. Do you have any other process listening on the port already? If so, you can override the port of windows exporter with –web.listen-address flag.
1 Like
Hi,
Thank you so much.
I got the following error:
C:\Program Files\windows_exporter>windows_exporter.exe --collectors.enabled="cpu,cpu_info,cs,memory,logon,physical_disk,net,os,service,system,textfile,thermalzone,tcp,udp,license" --web.listen-address
2024/12/28 03:18:06 ERROR Failed to parse CLI args err="expected argument for flag '--web.listen-address'"
You should pass the address to listen on, so it should look like
windows_exporter.exe --collectors.enabled=“cpu,cpu_info,cs,memory,logon,physical_disk,net,os,service,system,textfile,thermalzone,tcp,udp,license” --web.listen-address=“localhost:xxxx”
where xxxx
is the port (although I’m not sure about the localhost part, I have no exp in IT with windows
)
I changed the command as follows:
windows_exporter.exe --collectors.enabled="cpu,cpu_info,cs,memory,logon,physical_disk,net,os,service,system,textfile,thermalzone,tcp,udp,license" --web.listen-address="0.0.0.0:9182"
I got the following error:
time=2024-12-28T11:20:43.281Z level=WARN source=cs.go:75 msg="The cs collector is deprecated and will be removed in a future release. Logical processors has been moved to cpu_info collector. Physical memory has been moved to memory collector. Hostname has been moved to os collector."
time=2024-12-28T11:20:43.282Z level=WARN source=os.go:108 msg="The os collect holds a number of deprecated metrics and will be removed mid 2025. See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information." collector=os
time=2024-12-28T11:20:43.291Z level=INFO source=textfile.go:108 msg="textfile directories: C:\\Program Files\\windows_exporter\\textfile_inputs" collector=textfile
time=2024-12-28T11:20:43.763Z level=INFO source=main.go:311 msg="Running as DESKTOP-1PNH21K\\Grafana"
time=2024-12-28T11:20:43.763Z level=INFO source=main.go:228 msg="Enabled collectors: cpu, cpu_info, cs, memory, logon, physical_disk, net, os, service, system, textfile, thermalzone, tcp, udp, license"
time=2024-12-28T11:20:43.764Z level=INFO source=main.go:246 msg="starting windows_exporter in 502.5911ms" version=0.30.0-rc.4 branch=HEAD revision=78386557d4dcb168b82e87084db8faf04dacdd72 goversion=go1.23.4 builddate=20241222-13:19:26 maxprocs=3
time=2024-12-28T11:20:43.769Z level=ERROR source=main.go:283 msg="Failed to start windows_exporter" err="listen tcp 0.0.0.0:9182: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."```
9182 port is probably already in use, so you cannot use it once more. Can you check what’s running on the port? Try the same command with another port, e.g. 9183.
1 Like
This is the windows_exporter port. I wanted to change the collectors parameters, so I ran that command. How can I increase or decrease the collectors parameters?
Hi,
When I run the above command, the windows_exporter agent should write parameters to the enabled:
line in the config.yaml
file, but it doesn’t. Is this a problem?