This plugin provides native Docker instrumentation for monitoring and metrics collection, including: container status, container number, and container metrics via `docker ps`.
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.
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:
If you stop/down this container, the Sensu plugin works fine.
It's possible to solve it??