Skip to content

Instantly share code, notes, and snippets.

@glarizza
Created November 22, 2010 19:04
Show Gist options
  • Save glarizza/710447 to your computer and use it in GitHub Desktop.
Save glarizza/710447 to your computer and use it in GitHub Desktop.
### Module
module MCollective
module Agent
# A simpleRPC Agent that replies with each active config setting.
#
class Confignotify<RPC::Agent
action get_config
config = Config.instance
[:topicprefix, :daemonize, :pluginconf, :libdir, :configured, :logfile,
:keeplogs, :max_log_size, :loglevel, :identity, :daemonize, :connector,
:securityprovider, :factsource, :registration, :registerinterval, :topicsep,
:classesfile, :rpcauditprovider, :rpcaudit, :configdir, :rpcauthprovider,
:rpcauthorization, :color, :configfile, :rpchelptemplate, :rpclimitmethod].each do |item|
reply[item] = config.send(item)
end
end
end
end
end
#### Output from mc-irb
bash-3.2# mc-irb confignotify
The Marionette Collective Interactive Ruby Shell version @DEVELOPMENT_VERSION@
Active Filter matched 1 hosts:
Identity: []
Classes: []
Facts: []
Agents: ["confignotify"]
Use mc? to get help on using this shell
>> rpc :runcommand, :command => "get_config"
Finished processing 0 / 1 hosts in 5000.98 ms
No response from:
boe.huronhs.com
=> true
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment