Created
September 3, 2013 09:46
-
-
Save odyssey4me/6421795 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# vim:ts=2:expandtab | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
puts "Current CouchDB active tasks:" | |
uri = URI.parse("http://localhost:5984/_active_tasks") | |
res = Net::HTTP.get_response(uri) | |
puts JSON.pretty_generate(JSON.parse(res.body)) | |
puts "Current chef database status:" | |
uri = URI.parse("http://localhost:5984/chef") | |
res = Net::HTTP.get_response(uri) | |
puts JSON.pretty_generate(JSON.parse(res.body)) | |
%w(nodes roles registrations clients data_bags data_bag_items users checksums cookbooks sandboxes environments id_map).each do |view| | |
begin | |
uri = URI.parse("http://localhost:5984/chef/_design/#{view}/_info") | |
res = Net::HTTP.get_response(uri) | |
puts "Current status for chef view: #{view}" | |
puts JSON.pretty_generate(JSON.parse(res.body)) | |
rescue | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment