run_agent_command
Execute shell commands on remote endpoints via UTMStack interactive console. Returns command output directly from the agent.
Instructions
Run a shell command on an agent via the interactive console and return its output.
DANGER: this executes the command for real on the live endpoint identified by
hostname (same capability as the UTMStack web "interactive console"). Treat
it like a remote shell — only run commands you are authorized to run there.
Mechanism: opens a STOMP-over-SockJS session at /ws (xhr-polling transport), SUBSCRIBEs to /user/topic/{hostname}, SENDs the command to /app/command/{hostname}, and returns the MESSAGE output. Requires a JWT (the target server's user+pass or static jwt) — the Utm-Api-Key alone is rejected by the console endpoint.
Args: hostname: target agent hostname (must support remote commands). command: the shell command line to execute. shell: "cmd" (Windows) or "bash" (Linux). Auto-detected from the agent OS when left blank. timeout_seconds: max time to wait for command output. server: which configured server to target (default active/default).
Returns a JSON blob with the command output (or an error/diagnostic).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shell | No | ||
| server | No | ||
| command | Yes | ||
| hostname | Yes | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |