Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1019 Bytes

agentexecutecommandwithoutput.adoc

File metadata and controls

31 lines (25 loc) · 1019 Bytes

AgentExecuteCommandWithOutput()

AgentExecuteCommandWithOutput(node, commandName, …) ⇒ String

Execute agent command (action) on given node and collect standard output of the application defined by the command. Optional arguments starting from 3rd are passed as command arguments to the agent.

Note
Prior to v. 4.2. this function was named AgentExecuteActionWithOutput.
Table 1. Parameters

node

[class-node] object instance (e.g. $node)

commandName

Name of the command to be executed

Optional arguments for command

Return

Output of the command or null if execution failed.

Example
>>> AgentExecuteCommandWithOutput($node, "Custom.Ping", "10.10.8.16");
PING 10.10.8.16 (10.10.8.16): 56 data bytes
64 bytes from 10.10.8.16: icmp_seq=0 ttl=64 time=0.084 ms
64 bytes from 10.10.8.16: icmp_seq=1 ttl=64 time=0.120 ms
64 bytes from 10.10.8.16: icmp_seq=2 ttl=64 time=0.121 ms