Architecture, Flow and Terminology15. Agent
service.rb
Small ruby classes
that manage
services, packages,
etc.
Hosted by the
mcollective-0.4.7.noarch.rpm
server
mcollective-common-0.4.7.noarch.rpm
20. The Marionette Collective
* Discover with filter
* Send request with filter
* Wait for responses matching discovery
mc-service -W country=za httpd status
21. Request - Discovery - Request ID
{:msgtime=>1280270404,
:requestid=>"a48b4f84d66ff0c30c621d544750a081",
:msgtarget=>"/topic/mcollective.discovery.command",
:callerid=>"cert=rip",
:filter=>
{"identity"=>[],
"fact"=>[{:fact=>"country", :value=>"za"}],
"agent"=>[“service”],
"cf_class"=>[]},
:senderid=>"nephilim.ml.org",
:body=>"ping",
:hash=> "xxxxx"}
mc-service -W country=za httpd status
22. Request - Discovery - Target
{:msgtime=>1280270404,
:requestid=>"a48b4f84d66ff0c30c621d544750a081",
:msgtarget=>"/topic/mcollective.discovery.command",
:callerid=>"cert=rip",
:filter=>
{"identity"=>[],
"fact"=>[{:fact=>"country", :value=>"za"}],
"agent"=>[“service”],
"cf_class"=>[]},
:senderid=>"nephilim.ml.org",
:body=>"ping",
:hash=> "xxxxx"}
mc-service -W country=za httpd status
23. Request - Discovery - Filter
{:msgtime=>1280270404,
:requestid=>"a48b4f84d66ff0c30c621d544750a081",
:msgtarget=>"/topic/mcollective.discovery.command",
:callerid=>"cert=rip",
:filter=>
{"identity"=>[],
"fact"=>[{:fact=>"country", :value=>"za"}],
"agent"=>[“service”],
"cf_class"=>[]},
:senderid=>"nephilim.ml.org",
:body=>"ping",
:hash=> "xxxxx"}
mc-service -W country=za httpd status
24. Request - Discovery - Body
{:msgtime=>1280270404,
:requestid=>"a48b4f84d66ff0c30c621d544750a081",
:msgtarget=>"/topic/mcollective.discovery.command",
:callerid=>"cert=rip",
:filter=>
{"identity"=>[],
"fact"=>[{:fact=>"country", :value=>"za"}],
"agent"=>[“service”],
"cf_class"=>[]},
:senderid=>"nephilim.ml.org",
:body=>"ping",
:hash=> "xxxxx"}
mc-service -W country=za httpd status
25. Request - Discovery - Reply
{:msgtime=>1280270802,
:requestid=>"a48b4f84d66ff0c30c621d544750a081",
:senderagent=>"discovery",
:body=>"pong",
:senderid=>"my.machine.co.za",
:msgtarget=>"/topic/mcollective.discovery.reply",
:hash=> "xxx"}
mc-service -W country=za httpd status
26. Request - RPC Request - Filter
{:msgtime=>1280271069,
:filter=>
{"identity"=>[],
"fact"=>[{:value=>"za", :fact=>"country"}],
"agent"=>["service"],
"cf_class"=>[]},
:requestid=>"3b57f528746828c9f77d2d1956b94eb9",
:msgtarget=>"/topic/mcollective.service.command",
:callerid=>"cert=rip",
:body=>
{:agent => “service"
:action => “status”,
:service => “httpd”},
:senderid=>"nephilim.ml.org",
:hash=> "xxxx"}
mc-service -W country=za httpd status
27. Request - RPC Request - Target
{:msgtime=>1280271069,
:filter=>
{"identity"=>[],
"fact"=>[{:value=>"za", :fact=>"country"}],
"agent"=>["service"],
"cf_class"=>[]},
:requestid=>"3b57f528746828c9f77d2d1956b94eb9",
:msgtarget=>"/topic/mcollective.service.command",
:callerid=>"cert=rip",
:body=>
{:agent => “service"
:action => “status”,
:service => “httpd”},
:senderid=>"nephilim.ml.org",
:hash=> "xxxx"}
mc-service -W country=za httpd status
28. Request - RPC Request - RPC Body
{:msgtime=>1280271069,
:filter=>
{"identity"=>[],
"fact"=>[{:value=>"za", :fact=>"country"}],
"agent"=>["service"],
"cf_class"=>[]},
:requestid=>"3b57f528746828c9f77d2d1956b94eb9",
:msgtarget=>"/topic/mcollective.service.command",
:callerid=>"cert=rip",
:body=>
{:agent => “service"
:action => “status”,
:service => “httpd”},
:senderid=>"nephilim.ml.org",
:hash=> "xxxx"}
mc-service -W country=za httpd status
29. Request - RPC Reply
{:msgtime=>1280272138,
:requestid=>"3b57f528746828c9f77d2d1956b94eb9",
:body=> {:statuscode => 0,
:statusmsg => “OK”,
:data{:status => “running"}}
:senderagent=>"service",
:senderid=>"my.machine.co.za",
:hash=> "xxxxx",
:msgtarget=>"/topic/mcollective.service.reply"}
mc-service -W country=za httpd status