This repo provides a wrapper to run bulk-show.py on vManage and collect logs from multiple SD-WAN devices.
English: README.md
Japanese: README.ja.md
The wrapper uploads bulk-show.py + input files to vManage, runs the script remotely, and optionally downloads output logs.
Execution flow (overview):
Flow diagram:
Local PC -> SSH -> vManage -> vshell -> bulk-show.py -> SD-WAN devices
-> <remote-dir>/<timestamp>/logs
-> download -> ./logs/<timestamp>/
Log output:
Usage:
python3 run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> [--password <password> | --key <key_path>] \ --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs [--verbose] [--quiet]
Example (password):
python3 run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --password <password> \ --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs --verbose
Example (SSH key):
python3 run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --key ~/.ssh/id_rsa \ --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs --verbose
Notes:
The script creates a timestamped subdirectory under --remote-dir for each run, uploads files there,
and writes logs to //logs.
Use --verbose for detailed remote output, or --quiet for minimal logs.
Put the hosts file and command file in the same directory.
The hosts file contains: IP address (system-ip), username, password.
$ more hosts.txt 2.1.1.1,admin,admin 3.1.1.1,admin,admin 4.1.1.1,admin,admin
The command file contains the show commands you want to run.
Example commands file:
show version show ip int bri show ip route show sdwan control connections
Example:
python3 bulk-show.py hosts.txt commands.txt
Logs are saved under ./logs with timestamps in the file name.
You can override the log directory with --logs-dir.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtWindows (PowerShell):
.\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip python -m pip install -r requirements.txt
Windows (cmd):
.\.venv\Scripts\activate.bat python -m pip install --upgrade pip python -m pip install -r requirements.txt
python bulk-show.py hosts.txt commands.txt python run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --password <password> --remote-dir /home/<username> --download-outputs
Password auth:
python3 run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --password <password> \ --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs
Windows (PowerShell):
python run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --password <password> ` --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs
Windows (PowerShell, single line):
python run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --password <password> --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs
Windows (cmd):
python run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --password <password> --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs
SSH key auth:
python3 run_on_vmanage.py <vManage FQDN/IPaddress> --user <username> --key ~/.ssh/id_rsa \ --remote-dir /home/<username> --hosts host.txt --commands command.txt --download-outputs
Prepare hosts/commands:
cat > host.txt <<'EOF' 2.1.1.1,admin,admin 2.1.1.4,admin,admin 2.1.1.5,admin,admin EOF cat > command.txt <<'EOF' show ip route show omp route show ip int bri EOF
Run:
python3 bulk-show.py host.txt command.txt
Windows (PowerShell):
python bulk-show.py host.txt command.txtWindows (cmd):
python bulk-show.py host.txt command.txt
Output:
./logs/output_<ip>_<YYYYmmdd_HHMMSS>.txt
Owner
Contributors
Categories
NetworkingAnalytics & AutomationProducts
Catalyst SD-WANProgramming Languages
PythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community