check-aggregate is broken

Hi,

the plugin check-aggregate.rb is broken after Sensu update (0.24) I think it’s because “aggregate 2.0” that API return a different value that the plugins is expecting.

root@ip-10-154-255-62:/opt/sensu/embedded/bin# ./check-aggregate.rb -a http://localhost:4567 -c V1 -C 10
Check failed to run: bad URI(is not URI?): http://localhost:4567/aggregates/V1/[:results, {:ok=>0, :warning=>0, :critical=>1, :unknown=>0, :total=>1, :stale=>0}], ["/opt/sensu/embedded/lib/ruby/2.3.0/uri/rfc3986_parser.rb:67:in split'", "/opt/sensu/embedded/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:inparse’", “/opt/sensu/embedded/lib/ruby/2.3.0/uri/common.rb:227:in parse'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:276:inparse_url’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:280:in parse_url_with_auth'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:175:inexecute’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in execute'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/resource.rb:51:inget’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-sensu-0.1.0/bin/check-aggregate.rb:95:in api_request'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-sensu-0.1.0/bin/check-aggregate.rb:119:inacquire_aggregate’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-sensu-0.1.0/bin/check-aggregate.rb:161:in run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-plugin/cli.rb:56:inblock in class:CLI’”]

``

btw I opened a issue on github

···

On Wednesday, June 8, 2016 at 6:47:34 PM UTC-3, João Gabriel wrote:

Hi,

the plugin check-aggregate.rb is broken after Sensu update (0.24) I think it’s because “aggregate 2.0” that API return a different value that the plugins is expecting.

root@ip-10-154-255-62:/opt/sensu/embedded/bin# ./check-aggregate.rb -a http://localhost:4567 -c V1 -C 10
Check failed to run: bad URI(is not URI?): http://localhost:4567/aggregates/V1/[:results, {:ok=>0, :warning=>0, :critical=>1, :unknown=>0, :total=>1, :stale=>0}], ["/opt/sensu/embedded/lib/ruby/2.3.0/uri/rfc3986_parser.rb:67:in split'", "/opt/sensu/embedded/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:inparse’", “/opt/sensu/embedded/lib/ruby/2.3.0/uri/common.rb:227:in parse'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:276:inparse_url’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:280:in parse_url_with_auth'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:175:inexecute’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in execute'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0/lib/restclient/resource.rb:51:inget’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-sensu-0.1.0/bin/check-aggregate.rb:95:in api_request'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-sensu-0.1.0/bin/check-aggregate.rb:119:inacquire_aggregate’”, “/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-sensu-0.1.0/bin/check-aggregate.rb:161:in run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.2.0/lib/sensu-plugin/cli.rb:56:inblock in class:CLI’”]

``