Created attachment 557694 [details] CLI Doc example 7.2.6 Description of problem: executing CLI doc example 7.2.6 gives error Version-Release number of selected component (if applicable): JON 3.01 RC1 How reproducible:100% mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -f myCLIscript2.js Remote server version is: 3.0.1.GA (784c8ce:5cde182) Login successful Scanning all RHQ Agent instances Exception in thread "main" org.rhq.enterprise.client.script.CLIScriptException: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "agents" is not defined. (<Unknown source>#10) in <Unknown source> at line number 10 at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:270) at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:101) at org.rhq.enterprise.client.ClientMain.processArguments(ClientMain.java:519) at org.rhq.enterprise.client.ClientMain.main(ClientMain.java:106) Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "agents" is not defined. (<Unknown source>#10) in <Unknown source> at line number 10 at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:133) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:259) ... 3 more Caused by: sun.org.mozilla.javascript.EcmaError: ReferenceError: "agents" is not defined. (<Unknown source>#10) at sun.org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654) at sun.org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632) at sun.org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717) at sun.org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1692) at sun.org.mozilla.javascript.gen.c299._c0(<Unknown source>:10) at sun.org.mozilla.javascript.gen.c299.call(<Unknown source>) at sun.org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398) at sun.org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065) at sun.org.mozilla.javascript.gen.c299.call(<Unknown source>) at sun.org.mozilla.javascript.gen.c299.exec(<Unknown source>) at sun.org.mozilla.javascript.Context.evaluateReader(Context.java:1135) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:123) ... 5 more
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos
looks like it needs a decl for the 'agents' variable: + var agents = new Array(); var idx=0;
Reassigning to Deon so she can add the missing line to the script in the docs.
Link to fix: http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Operations_Network/100/html/Running_JON_Command-Line_Scripts/Control_Grouped_Servers_via_the_CLI.html#Creating_the_JON_Scripts-Scheduling_an_operation
Closing.