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

procstat response when monitored process dies #586

Closed
aodj opened this issue Jan 26, 2016 · 8 comments
Closed

procstat response when monitored process dies #586

aodj opened this issue Jan 26, 2016 · 8 comments
Labels
area/procstat feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@aodj
Copy link

aodj commented Jan 26, 2016

Could we improve the response of the procstat input such that when a process dies, it still continues to send some metrics, ideally something signalling that the process has died. Currently, the input outputs a message saying Error: procstat getting process, exe: [] pidfile: [] pattern: [hekas] Failed to execute pgrep. Error: 'exit status 1' (or similar when using pid_file).

@sparrc
Copy link
Contributor

sparrc commented Jan 26, 2016

@aodj What would you suggest that procstat sends when the process dies?

@aodj
Copy link
Author

aodj commented Jan 27, 2016

I'm not sure exactly. I initially thought that you could send a process_alive measurement, which changes to false when the /proc endpoint returns file not existing, but then you're sending an extra value with each metric push. It could be an opt in setting like an include_heart_beat option in the input, but I was basically looking for some way to determine when a process has died, without having to rely upon the time since last metric received.

@sparrc
Copy link
Contributor

sparrc commented Jan 29, 2016

opting-in to that seems fine

@asangal
Copy link

asangal commented Jan 7, 2017

This issue may happen if you have multiple entries in one file:

[[inputs.procstat]]
     exe = "telegraf"
     prefix = "pgrep_svcs_process"

[[inputs.procstat]]
     exe = "jenkins"
     prefix = "pgrep_svcs_process"

[[inputs.procstat]]
     exe = "docker"
     prefix = "pgrep_svcs_process"


To fix it, you can just use a pattern "." or "telegraf|." for exe = <exe_pattern> and then you don't have to create N no. of separte files.

[[inputs.procstat]]
    exe = "telegraf|.*"
    prefix = "pgrep_svcs_process"

I preferred "telegraf|." over just ".*" or just "." as it'll make it more easy to tell who's doing the pattern matching if you use exe = <..> in a query.

@fchiorascu
Copy link

Hi,

Issue:
2017-12-12T14:33:36Z E! Error in plugin [inputs.procstat]: E! Error: procstat getting process, exe: [memcached] pidfile: [] pattern: [] user: [] Error running /bin/pgrep: exit status 1
2017-12-12T14:33:37Z E! Error in plugin [inputs.procstat]: E! Error: procstat getting process, exe: [java] pidfile: [] pattern: [] user: [] Error running /bin/pgrep: exit status 1
2017-12-12T14:33:37Z E! Error in plugin [inputs.procstat]: E! Error: procstat getting process, exe: [nginx] pidfile: [] pattern: [] user: [] Error running /bin/pgrep: exit status 1

What I want to achieve:
-To monitor all processes and to have the metrics available in Grafana.

  • Unfortunately I've tried many approaches proposed on internet and I don't have Graphs in Grafana.

Recommendation how to look the procstat config?
[[inputs.procstat]]
exe = "?"
prefix = "?"

Kind Regards,

@danielnelson
Copy link
Contributor

@fchiorascu You should be able to do this:

[[inputs.procstat]]
  exe = "memcached"
  prefix = "memcached"

Unfortunately, the procstat plugin does currently show this error when the process is not running, so make when you run pgrep memcached it matches a process.

@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Jun 6, 2018
@danielnelson
Copy link
Contributor

I wrote a short proposal on how I think we should fix this in #4237

@danielnelson danielnelson added this to the 1.8.0 milestone Aug 13, 2018
@danielnelson
Copy link
Contributor

The solution in #4237 has been implemented for 1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/procstat feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

5 participants