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

Error when a container is Restarting and option -P is used in the metric-container-stats.rb #84

Open
asanchez1978 opened this issue Aug 26, 2019 · 0 comments

Comments

@asanchez1978
Copy link

If the option -P is used in the metric-container-stats.rb and one of the docker containers has the state Restarting, an error appears when Sensu executes the plugin.
Ex:
/opt/sensu/embedded/bin/metrics-docker-stats.rb -H /var/run/docker.sock -n -P

Error:

mongo-historico-conf.id 5b90c05015de78d7f5489d142f74998a5a6250d13b455e985bde12450e3596a6 1566806214
Check failed to run: undefined method `-' for nil:NilClass, ["/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.2.0/bin/metrics-docker-stats.rb:212:in `calculate_cpu_percent'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.2.0/bin/metrics-docker-stats.rb:153:in `output_stats'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.2.0/bin/metrics-docker-stats.rb:135:in `block in run'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.2.0/bin/metrics-docker-stats.rb:121:in `each'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.2.0/bin/metrics-docker-stats.rb:121:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.7.1/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]

If you stop/down this container, the Sensu plugin works fine.

It's possible to solve it??

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