Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed collecting os metrics #923

Closed
xll970211 opened this issue Jan 21, 2022 · 10 comments
Closed

failed collecting os metrics #923

xll970211 opened this issue Jan 21, 2022 · 10 comments

Comments

@xll970211
Copy link

i run win11 and windows server 2008 is ok,but run in windows server 2012 has error

time="2022-01-21T15:48:57+08:00" level=error msg="Error reading textfile collect
or directory \"C:\\\\Users\\\\Administrator\\\\Desktop\\\\textfile_inputs\": ope
n C:\\Users\\Administrator\\Desktop\\textfile_inputs: The system cannot find the
 file specified." source="textfile.go:249"
time="2022-01-21T15:48:57+08:00" level=error msg="failed collecting os metrics:<
nil> The system cannot find the file specified." source="os.go:137"
time="2022-01-21T15:48:57+08:00" level=error msg="collector os failed after 0.00
0980s: The system cannot find the file specified." source="exporter.go:207"
time="2022-01-21T15:49:02+08:00" level=error msg="Error reading textfile collect
or directory \"C:\\\\Users\\\\Administrator\\\\Desktop\\\\textfile_inputs\": ope
n C:\\Users\\Administrator\\Desktop\\textfile_inputs: The system cannot find the
 file specified." source="textfile.go:249"
time="2022-01-21T15:49:02+08:00" level=error msg="failed collecting os metrics:<
nil> The system cannot find the file specified." source="os.go:137"
time="2022-01-21T15:49:02+08:00" level=error msg="collector os failed after 0.00
1958s: The system cannot find the file specified." source="exporter.go:207"
@yuanpengchao
Copy link

yuanpengchao commented Jan 25, 2022

you need run mkidr textfile_inputs at C:\Users\Administrator\Desktop\ (tips: Create directories according to your own error prompts)

Our Windows English server is running properly, Chinese server also has this error:
failed collecting os metrics:<
nil> The system cannot find the file specified." source="os.go:137

@xll970211
Copy link
Author

thank you very much.i I tried what you said mkdir textfile_inputs. The result is the same as you said
failed collecting os metrics:<
nil> The system cannot find the file specified." source="os.go:137
but we run in windows server 2008R2 Chinese,It won't happen
What should I do? @yuanpengchao

@yuanpengchao
Copy link

@xll970211 I'm looking for the answer to that question, too ……囧

@csrlsm
Copy link

csrlsm commented Jan 26, 2022

I use release 0.171 and the OS windows server 2012 , there is the same issue.
but in windows server 2019 it works

i run win11 and windows server 2008 is ok,but run in windows server 2012 has error

time="2022-01-21T15:48:57+08:00" level=error msg="Error reading textfile collect
or directory \"C:\\\\Users\\\\Administrator\\\\Desktop\\\\textfile_inputs\": ope
n C:\\Users\\Administrator\\Desktop\\textfile_inputs: The system cannot find the
 file specified." source="textfile.go:249"
time="2022-01-21T15:48:57+08:00" level=error msg="failed collecting os metrics:<
nil> The system cannot find the file specified." source="os.go:137"
time="2022-01-21T15:48:57+08:00" level=error msg="collector os failed after 0.00
0980s: The system cannot find the file specified." source="exporter.go:207"
time="2022-01-21T15:49:02+08:00" level=error msg="Error reading textfile collect
or directory \"C:\\\\Users\\\\Administrator\\\\Desktop\\\\textfile_inputs\": ope
n C:\\Users\\Administrator\\Desktop\\textfile_inputs: The system cannot find the
 file specified." source="textfile.go:249"
time="2022-01-21T15:49:02+08:00" level=error msg="failed collecting os metrics:<
nil> The system cannot find the file specified." source="os.go:137"
time="2022-01-21T15:49:02+08:00" level=error msg="collector os failed after 0.00
1958s: The system cannot find the file specified." source="exporter.go:207"

@breed808
Copy link
Contributor

breed808 commented Feb 3, 2022

The text file directory isn't relevant to the os collector, as it doesn't read the file.

However, it does open a few registry keys: SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management and SOFTWARE\Microsoft\Windows NT\CurrentVersion.

Are these present on the affected systems? Is this issue affecting all systems in a consistent manner?

@xll970211
Copy link
Author

v1.18.1 in windows server 2012R2 is ok

@petemounce
Copy link

Using 0.18.1 on Windows 2019 Standard, I am seeing log entries like:

{"level":"error","msg":"failed collecting os metrics:\u003cnil\u003e The system cannot find the file specified.","source":"os.go:137","time":"2022-03-14T15:07:37Z"}
{"level":"error","msg":"collector os failed after 0.003984s: The system cannot find the file specified.","source":"exporter.go:207","time":"2022-03-14T15:07:37Z"}

Looks like desc is nil, and collect returns an error. https://github.com/prometheus-community/windows_exporter/blob/master/collector/os.go#L136-L139. Therefore I don't know from the logs where to inspect my system for information.

I have made sure that the wmi_exporter service user-account has a Desktop/textfile_inputs directory created. I'm not sure what to look for within the registry to rule in/out other dependencies.

Unfortunately, I don't know whether this is systemic across my infrastructure because it's (currently; working on it!) on-premise and a little snowflake-y.

Happy to provide more information if needed.

@petemounce
Copy link

petemounce commented Mar 14, 2022

I have made sure that the wmi_exporter service user-account has a Desktop/textfile_inputs directory created. I'm not sure what to look for within the registry to rule in/out other dependencies.

Oops, actually I can see what the code is doing and what might be failing.

PS C:\Users\robot> get-childitem 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\'


    Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management


Name                           Property
----                           --------
PrefetchParameters             BootId   : 29
                               BaseTime : 653062305

Shows no "ExistingPageFiles" key. I'm loathe to create one by hand since I don't know enough about that bit of registry to understand the implications/dangers.

However - a different machine that isn't logging the errors, also doesn't have that key. So that's not it...

@breed808
Copy link
Contributor

The page file issue will be resolved in #954. Once that's merged, let me know if the issue persists with the os collector and we can investigate further.

@petemounce
Copy link

Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants