run_show_command_batch
Execute CLI show commands on multiple Junos devices concurrently using hostname or tag selection, with optional grep filtering to narrow output.
Instructions
Run a CLI show command on multiple devices in parallel.
Uses ThreadPoolExecutor for concurrent execution. Either hostnames
or tags selects the targets; if both are omitted, every router in
config.ini is targeted. When both are given, the intersection is used.
Args:
command: CLI command to execute on all devices
hostnames: List of target device hostnames (must exist in config.ini)
tags: Tag filter. Each list element is one tag group (comma-separated
tags AND together within a group). Multiple list elements OR
together across groups. E.g. ["tokyo,core", "backup"] means
(tokyo AND core) OR backup. Combined with hostnames the
result is the intersection.
grep_pattern: Optional Python re pattern. When set, only lines
matching the pattern (via re.search) are kept from each
host's output. Header lines (starting with #) are always
preserved. Hosts with no matching lines show (no match).
Reduces large batch outputs to the essential lines.
max_workers: Maximum parallel threads (default 5)
config_path: Path to config.ini (empty string uses default search)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| hostnames | No | ||
| tags | No | ||
| grep_pattern | No | ||
| max_workers | No | ||
| config_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |