Description
Hello,
found a bug with monitoring a Windows process.
If you use pattern searches with forms of a WMI query.
It does not work with telegraf versions newer as v1.14.5.
Example Config (working with telegraf 1.14.5):
[[inputs.procstat]]
pattern = "%tomcat%"
pid_finder = "native"
interval = "1m"
System info:
OS Windows Server 2016 / 2019
Version telegraf-1.14.5_windows_amd64.zip
Steps to reproduce:
- Use telegraf 1.14.5 and setup a process to monitor like my example above
- Now update telegraf to an newer version. With the WMI query, it says process is not running.
Configured as the readme says:
https://github.com/influxdata/telegraf/tree/master/plugins/inputs/procstat
Test output:
Telegraf 1.14.5
procstat_lookup,host=serverdev12,pattern=%tomcat%,pid_finder=native,result=success pid_count=3i,result_code=0i,running=3i 1606464960000000000
Telegraf 1.15.0
procstat_lookup,host=serverdev12,pattern=%tomcat%,pid_finder=native,result=success pid_count=0i,result_code=0i,running=0i 1606470057000000000
Telegraf 1.16.2
procstat_lookup,host=serverdev12,pattern=%tomcat%,pid_finder=native,result=success pid_count=0i,result_code=0i,running=0i 1606464970000000000
Telegraf 1.17.0
procstat_lookup,host=serverdev12,pattern=%tomcat%,pid_finder=native,result=success pid_count=0i,result_code=0i,running=0i 1606464970000000000