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

Uncaught exception in metrics-per-process.py #91

Open
boutetnico opened this issue Jun 21, 2019 · 0 comments
Open

Uncaught exception in metrics-per-process.py #91

boutetnico opened this issue Jun 21, 2019 · 0 comments

Comments

@boutetnico
Copy link

boutetnico commented Jun 21, 2019

This seems related to #25.

I had 3 occurences of the following Exception:

Traceback (mo st recent call last):
  File "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-process-checks-3.2.0/bin/metrics-per-process.py", line 330, in <module>
    main()
  File "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-process-checks-3.2.0/bin/metrics-per-process.py", line 318, in main
    pids = find_pids_from_name(options.process_name)
  File "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-process-checks-3.2.0/bin/metrics-per-process.py", line 119, in find_pids_from_name
    return find_pids(matcher)
  File "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-process-checks-3.2.0/bin/metrics-per-process.py", line 104, in find_pids
    if matcher(path):
  File "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-process-checks-3.2.0/bin/metrics-per-process.py", line 116, in matcher
    file_handler = open(path + '/comm', 'r')
IOError: [Errno 2] No such file or directory: '/proc/19630/comm'

In #25 we catch OSError to cover the case when directory /proc/<pid>/ does not exist.
In this issue however, it seems /proc/<pid>/ exists but /proc/<pid>/comm does not.

I believe we should catch both OSError & IOError to cover both cases.

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

1 participant