Closed Evesy closed 7 years ago
Hopefully some reassurance this change works!
http only stats endpoint:
[root@haproxy ~]# /opt/sensu/embedded/bin/check-haproxy.rb -S <domain> -P 1936 -s .* -q stats -u <user> -p <pass>
CheckHAProxy OK: UP: 100% of 1 /./ services
[root@haproxy ~]# /opt/sensu/embedded/bin/check-haproxy.rb -S <domain> -P 1936 -s .* -q stats -u <user> -p <pass> --use-ssl
Check failed to run: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol, ["/opt/sensu/embedded/lib/ruby/2.4.0/net/protocol.rb:44:in `connect_nonblock'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/protocol.rb:44:in `ssl_socket_connect'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:948: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:876:in `start'", "/opt/sensu/embedded/lib/ruby/2.4.0/net/http.rb:608:in `start'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-haproxy-1.2.0/bin/check-haproxy.rb:209:in `acquire_services'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-haproxy-1.2.0/bin/check-haproxy.rb:139:in `run'", "/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:58:in `block in <class:CLI>'"]
https only stats endpoint:
[root@haproxy ~]# /opt/sensu/embedded/bin/check-haproxy.rb -S <domain> -P 1936 -s .* -q stats -u <user> -p <pass>
Check failed to run: end of file reached, []
[root@haproxy ~]# /opt/sensu/embedded/bin/check-haproxy.rb -S <domain> -P 1936 -s .* -q stats -u <user> -p <pass> --use-ssl
CheckHAProxy OK: UP: 100% of 1 /./ services
Pull Request Checklist
RE https://github.com/sensu-plugins/sensu-plugins-haproxy/issues/12
General
[x] Update Changelog following the conventions laid out on Keep A Changelog
[x] Binstubs are created if needed
[x] RuboCop passes
[x] Existing tests pass
Purpose
As per linked issue
check-haproxy.rb
does not currently provide an option to use SSL, unlikemetrics-haproxy.rb
which already does.This change copies the implementation found in
metrics-haproxy.rb
Known Compatability Issues
None, SSL is disabled by default.