Skip to content

Instantly share code, notes, and snippets.

@kazu634
Created February 11, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazu634/d80d8ff78a7a7b4bfb16 to your computer and use it in GitHub Desktop.
Save kazu634/d80d8ff78a7a7b4bfb16 to your computer and use it in GitHub Desktop.
#!/opt/sensu/embedded/bin/ruby
require 'open-uri'
require 'json'
END_POINT = 'http://localhost:4567/clients'
BASIC_AUTH = {:http_basic_authentication => ['admin', 'supersecret']}
response = open(END_POINT, BASIC_AUTH)
clients = JSON.parse(response.read)
clients.each do |client|
puts client['name']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment