AgentExecuteCommandWithOutput()

Deprecated in 5.0.

Please use executeAgentCommandWithOutput() method of NetObj class.

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.

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

node

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.

>>> 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