Ask Your Question

Executing python script using Mcollective

asked 2014-09-12 14:57:54 -0500

oracle_mcollective gravatar image


I have a demo MCollective environment ( ) on which I am trying to create an agent plugin that runs a simple python script:

print "Hello, World!"

Here is the plugin code:

module MCollective
  module Agent
    class Testpy<RPC::Agent
      # Basic echo server
      action "echo" do
        implemented_by ""

and the DDL (which is same as the helloworld plugin from puppetlabs)

metadata :name        => "echo",

         :description => "Echo service for MCollective",

         :author      => "R.I.Pienaar",

         :license     => "GPLv2",

         :version     => "1.1",

         :url         => "
         :timeout     => 60

action "echo", :description => "Echos back any message it receives" do

   input :msg,

         :prompt      => "Service Name",

         :description => "The service to get the status for",

         :type        => :string,

         :validation  => '^[a-zA-Z\-_\d]+$',

         :optional    => false,

         :maxlength   => 30

   output :msg,

          :description => "The message we received",

          :display_as  => "Message"


However, I get the below error when running the plugin

[vagrant@middleware vagrant]$ mco rpc -v --display=all testpy echo msg="hellowo
Discovering hosts using the redis method .... 1

 * [ ==========================================================> ] 1 / 1                  : Unexpected failure calling
MCollective::RPCAborted: Cannot execute testpy#echo command:

---- testpy#echo call stats ----
           Nodes: 1 / 1
     Pass / Fail: 0 / 1
      Start Time: Fri Sep 12 19:47:15 +0000 2014
  Discovery Time: 4.15ms
      Agent Time: 10.63ms
      Total Time: 14.78ms

Can you please help? If the above method is not the right/best one to run a python script using mcollecitve, please suggest me one. Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-10-13 08:45:09 -0500

pers gravatar image

run this chmod +x

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-12 14:57:54 -0500

Seen: 446 times

Last updated: Sep 12 '14