Class MCollective::Agent::Discovery
In: plugins/mcollective/agent/discovery.rb
Parent: Object

Discovery agent for The Marionette Collective

Released under the Apache License, Version 2

Methods

handlemsg   help   new  

Attributes

meta  [R] 
timeout  [R] 

Public Class methods

[Source]

    # File plugins/mcollective/agent/discovery.rb, line 9
 9:             def initialize
10:                 @log = Log.instance
11: 
12:                 @timeout = Config.instance.pluginconf["discovery.timeout"].to_i || 5
13: 
14:                 @meta = {:license => "Apache License, Version 2",
15:                          :author => "R.I.Pienaar <rip@devco.net>"}
16:             end

Public Instance methods

[Source]

    # File plugins/mcollective/agent/discovery.rb, line 18
18:             def handlemsg(msg, stomp)
19:                 reply = "unknown request"
20: 
21:                 case msg[:body]
22:                     when "inventory"
23:                         reply = inventory
24: 
25:                     when /echo (.+)/
26:                         reply = $1
27: 
28:                     when "ping"
29:                         reply = "pong"
30: 
31:                     when /^get_fact (.+)/
32:                         reply = Facts[$1]
33: 
34:                     else
35:                         reply = "Unknown Request: #{msg[:body]}"
36:                 end
37: 
38:                 reply
39:             end

[Source]

    # File plugins/mcollective/agent/discovery.rb, line 41
41:             def help
42:                 "Discovery Agent\n===============\n\nAgent to facilitate discovery of machines and data about machines.\n\nAccepted Messages\n-----------------\n\ninventory     - returns a hash with various bits of information like\nlist of agents, threads, etc\n\nping          - simply responds with 'pong'\nget_fact fact - replies with the value of a facter fact\n"
43:             end

[Validate]