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

Check commands fail with remote docker host #65

Open
sjthespian opened this issue Jun 26, 2018 · 0 comments
Open

Check commands fail with remote docker host #65

sjthespian opened this issue Jun 26, 2018 · 0 comments

Comments

@sjthespian
Copy link

I just installed sensu-docker-plugins and it is working great with the local host, but I can't check remote docker hosts. It is failing with getaddrinfo() errors even if I specify an IP, which seems odd. Running docker commands with the docker CLI and DOCKER_HOST set works fine for the same remote host.

I have tried various combinations of hostname, fqdn, and ip; both with and without protocol and port with no luck. Using the -Y option the commands fail with in getaddrinfo(). If I try and use the environment variable it fails in sub().

I'm on sensu 1.2.1 with version 3.1.0 of the plugin.

For example:

> DOCKER_HOST=172.16.xxx.yyy docker ps
CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS                    PORTS                                                                        NAMES
... list of docker processes ...

> /opt/sensu/embedded/bin/check-docker-container.rb -H 172.16.xxx.yyy
Check failed to run: Failed to open TCP connection to http://172.16.xxx.yyy:2375 (getaddrinfo: Name or service not known), ["/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:906:in `rescue in block in connect'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:903:in `block in connect'", "/opt/sensu/embedded/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'", "/opt/sensu/embedded/lib/ruby/2.4.0/timeout.rb:103:in `timeout'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:902:in `connect'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/net_http_unix-0.2.2/lib/net_x/http_unix.rb:26:in `connect'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:887:in `do_start'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:882:in `start'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/lib/sensu-plugins-docker/client_helpers.rb:21:in `initialize'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/bin/check-docker-container.rb:104:in `new'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/bin/check-docker-container.rb:104:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.5.0/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]

> DOCKER_HOST=172.16.xxx.yyy /opt/sensu/embedded/bin/check-container.rb -N flexget
Check failed to run: can't modify frozen String, ["/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/lib/sensu-plugins-docker/client_helpers.rb:8:in `sub!'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/lib/sensu-plugins-docker/client_helpers.rb:8:in `initialize'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/bin/check-container.rb:66:in `new'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-docker-3.1.0/bin/check-container.rb:66:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-2.5.0/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]
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