windows_exporter
windows_exporter copied to clipboard
Exporter can't use the right SQL Server Instance Name
I installed the version 0.24 of the windows_exporter, and enable the mssql colector, but it's trying to get the MSSQLSERVER instance, although the windows reg key has the right value (PROD) ;
Am I doing something wrong here?
Hi @maurodouglas
Can you see in the logs the following warning ?(Most probably in windows eventviewer, it depends how you run the service and what log level is set) https://github.com/prometheus-community/windows_exporter/blob/9c0be5fd48b0fa417e21b98466c45c0595402bd9/collector/mssql.go#L44
In case win exporter can not open the registry it should print that message followed by the error which should indicate why it can not open the registry.
Hi @maurodouglas
Can you see in the logs the following warning ?(Most probably in windows eventviewer, it depends how you run the service and what log level is set)
https://github.com/prometheus-community/windows_exporter/blob/9c0be5fd48b0fa417e21b98466c45c0595402bd9/collector/mssql.go#L44
In case win exporter can not open the registry it should print that message followed by the error which should indicate why it can not open the registry.
Thanks for the response;
Here's all the log
C:\Program Files (x86)\windows_exporter>"C:\Program Files (x86)\windows_exporter\windows_exporter.exe" --config.file=config.yml --collectors.enabled="cs,os,cpu,mssql,memory,system,logical_disk,net,tcp,process,service"
ts=2023-11-10T15:40:57.656Z caller=config.go:63 level=info msg="Loading configuration file: config.yml"
ts=2023-11-10T15:40:57.657Z caller=exporter.go:91 level=debug msg="Initializing SWbemServices"
ts=2023-11-10T15:40:57.879Z caller=collector.go:51 level=debug msg="Detected Windows version 6.300000\n"
**ts=2023-11-10T15:40:57.879Z caller=mssql.go:44 level=warn collector=mssql msg="Couldn't open registry to determine SQL instances" err="The system cannot find the file specified."**
ts=2023-11-10T15:40:57.881Z caller=process.go:113 level=warn collector=process msg="No filters specified for process collector. This will generate a very large number of metrics!"
ts=2023-11-10T15:40:57.881Z caller=collector.go:51 level=debug collector=cpu msg="Detected Windows version 6.300000\n"
ts=2023-11-10T15:40:57.882Z caller=service.go:60 level=warn collector=service msg="No where-clause specified for service collector. This will generate a very large number of metrics!"
But I Can get the key value from cmd prompt;
The only thing I can think of now is that its some sort of access issue. Have you tried running the windows_exporter as Administrator as you did for Reg Query...
in CMD ?
Yeah I used the same prompt;
On the KEY I set full access to everybody;
I resolved the issue altering the default value for PROD and building a version;
sqlDefaultInstance["PROD"] = ""
I tried to reproduce your issue again and the only way I could was if I added a space to the SQL Key like:
The diff between with and without space on the SQL key is barely seeable but if I look on your screenshot it might be possible that there is one.
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.