Last active
August 29, 2015 14:04
-
-
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)
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 | |
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