windows_exporter: process: invalid query

wmi_exporter-0.2.7 Win 10 64-bit

.\wmi_exporter.exe "-collectors.enabled" "process" "-collector.process.processes-where
" "Name='notepad.exe'"
2017/08/15 18:57:28 warning: Couldn't open registry to determine IIS version: Le fichier spécifié est introuvable.
time="2017-08-15T18:57:28-04:00" level=info msg="Enabled collectors: process" source="exporter.go:213"
time="2017-08-15T18:57:28-04:00" level=info msg="Starting WMI exporter (version=0.2.7, branch=master, revision=44c39405c
79fd753a710b9b8295df23f7aefa282)" source="exporter.go:224"
time="2017-08-15T18:57:28-04:00" level=info msg="Build context (go=go1.8, user=appvyr-win\\appveyor@APPVYR-WIN, date=201
70810-22:37:09)" source="exporter.go:225"
time="2017-08-15T18:57:28-04:00" level=info msg="Starting server on :9182" source="exporter.go:228"
2017/08/15 18:57:31 [ERROR] failed collecting process metrics: <nil> Une exception s’est produite. (Demande non valide )
time="2017-08-15T18:57:31-04:00" level=error msg="ERROR: process collector failed after 0.016003s: Une exception s’est p
roduite. (Demande non valide )" source="exporter.go:90"
2017/08/15 18:57:31 [ERROR] failed collecting process metrics: <nil> Une exception s’est produite. (Demande non valide )
time="2017-08-15T18:57:31-04:00" level=error msg="ERROR: process collector failed after 0.006001s: Une exception s’est p
roduite. (Demande non valide )" source="exporter.go:90"

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

@bbigras Really weird. Could you try adding a log statement which outputs the query to collector/process.go? Basically add log.Println(q) here: https://github.com/martinlindhe/wmi_exporter/blob/94caf8ee61027bd02ae694353597741182b00829/collector/process.go#L183-L187

@martinlindhe You only get one firefox process due to matching exactly on 'firefox'. WMI separates multiple instances of the same name by adding a number after the name, so you get firefox.exe, firefox.exe#1 and firefox.exe#2. These suffixes are handled here, if present: https://github.com/martinlindhe/wmi_exporter/blob/94caf8ee61027bd02ae694353597741182b00829/collector/process.go#L194-L195

To get all the processes, you need to change the where-clause to Name LIKE 'firefox%', though. I thought this was documented somewhere, but I don’t see it now…