i am using the procstat plugin to gather information of a running process.
the process runs for 6hrs(0900-1500hrs) daily. when the process is taken down procstat starts returning process_name as pgrep and the pid keeps changing.
the frequency of these pgrep process_names are not periodic also.
i am trying to create a column which will say running/not_running based on whether pid value is being received or not.
is this a intended behavior of procstat plugin to report the pid of the pgrep command when the actual process is not running or am i missing something here.
please help
It should indeed not occur for pgrep to return its own pid when the process is not running. Could you share a relevant part of your config (in code blocks please)
Sure. You can open the issue here on the Telegraf Github project. You need a Github account for that I guess…
The link takes you to a form asking you for some things. For reproducing the issue on my side, the most important items are:
The relevant config part, in your case the inputs.procstat section. Please redact sensible information before putting it there.
The relevant part of the environment you run Telegraf in. How do you start Telegraf? Does it run on the machine or in a Docker container etc. Which version of Telegraf are you using? In your case you should mention that the process PID you are querying does not exist.
The output of Telegraf, i.e. an error message, the log-lines relevant to the issue, but also the metric you see.