Skip to content

metrics-http-json.rb HTTP basic auth  #148

Description

@noahbailey

Extracting metrics from an api endpoint that requires authentication fails in a strange way.
When the --url parameter is formatted like "user:pass@localhost:8080" the check fails with this output:

Check failed to run: Failed to open TCP connection to http:80 (getaddrinfo: Name or service not known), ["/usr/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect'", "/usr/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'", "/usr/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'", "/usr/lib/ruby/2.3.0/timeout.rb:101:in `timeout'", "/usr/lib/ruby/2.3.0/net/http.rb:878:in `connect'", "/usr/lib/ruby/2.3.0/net/http.rb:863:in `do_start'", "/usr/lib/ruby/2.3.0/net/http.rb:852:in `start'", "/var/lib/gems/2.3.0/gems/rest-client-2.0.2/lib/restclient/request.rb:715:in `transmit'", "/var/lib/gems/2.3.0/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in `execute'", "/var/lib/gems/2.3.0/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in `execute'", "/var/lib/gems/2.3.0/gems/sensu-plugins-http-5.1.1/bin/metrics-http-json.rb:91:in `run'", "/var/lib/gems/2.3.0/gems/sensu-plugin-4.0.0/lib/sensu-plugin/cli.rb:59:in `block in <class:CLI>'"]

Of course, the request is not for port 80, making this failure perplexing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions