Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active August 29, 2015 14:04
Show Gist options
  • Save raphink/a752dd3d4c51a78897f8 to your computer and use it in GitHub Desktop.
Save raphink/a752dd3d4c51a78897f8 to your computer and use it in GitHub Desktop.
List unresponsive hosts in MCollective using the PuppetDB discovery plugin (https://github.com/ploubser/mcollective-puppetdb-discovery)
#!/usr/bin/ruby
require 'mcollective'
include ::MCollective::RPC
mc = rpcclient('rpcutil')
mc.discovery_method = 'puppetdb'
mc.progress = false
mc.ping
if mc.stats.noresponsefrom.any?
puts "Unresponsive:\n"
puts mc.stats.noresponsefrom.join("\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment