1 A simple helper to assist with writing MCollective actions in PHP.
3 Given an action as below:
7 validate :message, String
9 implemented_by "/tmp/echo.php"
13 The following PHP script will implement the echo action externally
14 replying with _message_ and _timestamp_
18 require("mcollective_action.php");
20 $mc = new MCollectiveAction();
21 $mc->message = $mc->data["message"];
22 $mc->timestamp = strftime("%c");
23 $mc->info("some text to info log on the server");
27 Calling it with _mco rpc_ results in:
30 $ mco rpc test echo message="hello world"
31 Determining the amount of hosts matching filter for 2 seconds .... 1
33 * [ ============================================================> ] 1 / 1
37 {:message=>"hello world", :time=>"Tue Mar 15 19:20:53 +0000 2011"}