- Products
- Learn
- Local User Groups
- Partners
- More
Policy Insights and Policy Auditor in Action
19 November @ 5pm CET / 11am ET
Access Control and Threat Prevention Best Practices
Watch HereOverlap in Security Validation
Help us to understand your needs better
CheckMates Go:
Maestro Madness
Hey,
Is there a way to get the dynamic/static routes from VSX virtual systems (VS/VR) using the Run-Script API command?
Meaning, build a script body composed of several CLI commands, such as:
vsenv <vsid>
show route
Thanks in advance.
Try building a one-liner like this:
sh -c 'command 1;command 2;third "command with quotes";fourth \'command with ticks\';command 5'
I haven't used this construct with Run-Script before, but I use it with xargs all the time.
Thanks Bob.
My problem is that I've to run that commands in CLISH mode.
Is there a way to change the CLI mode using run-script API command?
For example: >>clish;set virtual-system 4;show route;
I've also tried: clish -c 'set virtual-system 4;show route;' with no success - run-script failed
Yeah, that's a limitation of clish. It's pretty solidly useless for troubleshooting or most automation. The best workaround I've found so far would be something like this:
sh -c 'printf "set virtual-system 4\nshow route\nexit\n" | clish'
That way, you can wrap the pipeline, do other commands to process the data locally on the firewall, then you get the eventual result back at the management.
There is also now the GAiA API which might be able to do what you want without involving clish.
Probably this won't be perfect for you because you mention of use clish only. But in case you have an expert level access, then you can use following:
for i in /proc/vrf/*; do i=${i#*vrf/}; vsenv $i; echo "set virtual-system" $i > /tmp/clishcmd; echo "show route" >> /tmp/clishcmd; clish -i -f /tmp/clishcmd; done
Just change show route for any other command which you need.
Thank you Petr,
I've tried that in expert mode but it didn't work correctly.
It requires CLISH mode to respond with the correct results (for the combination of "set virtual-system ID" and "show route").
can't you create shell script and then add custom clish command?
Usage: add command <command name> path <command path> description <command description>
we use those for "special" users that can execute only one command in clish that's script based
essentially you map clish command to a shell script
Hey, I cannot, it's customer's device and we are not allowed to upload bash scripts there.
Hi Kaspars,
I could not find a specific thread for this query, but this is the closest I think.
I've created a bunch of VS's using vsx_provisioning_tool on R82, however things I could not do are adding comments, changing the colour of the object and setting the main ip (need to change it).
So I looked at mgmt_cli api commands and I still can't see anything, so was wondering if this can be done using API?
Failing that I would need to go into every object and update (not a biggy but wanted to get it done using a script).
Legacy VSX objects do not have API support.
VSnext (from R82), on the other hand, does.
Thanks. So In my case will just need to update additional parameter manually.
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
Wed 26 Nov 2025 @ 12:00 PM (COT)
Panama City: Risk Management a la Parrilla: ERM, TEM & Meat LunchWed 03 Dec 2025 @ 10:00 AM (COT)
Última Sesión del Año – CheckMates LATAM: ERM & TEM con ExpertosThu 04 Dec 2025 @ 12:30 PM (SGT)
End-of-Year Event: Securing AI Transformation in a Hyperconnected World - APACThu 04 Dec 2025 @ 03:00 PM (CET)
End-of-Year Event: Securing AI Transformation in a Hyperconnected World - EMEAThu 04 Dec 2025 @ 02:00 PM (EST)
End-of-Year Event: Securing AI Transformation in a Hyperconnected World - AmericasWed 03 Dec 2025 @ 10:00 AM (COT)
Última Sesión del Año – CheckMates LATAM: ERM & TEM con ExpertosThu 04 Dec 2025 @ 12:30 PM (SGT)
End-of-Year Event: Securing AI Transformation in a Hyperconnected World - APACThu 04 Dec 2025 @ 03:00 PM (CET)
End-of-Year Event: Securing AI Transformation in a Hyperconnected World - EMEAThu 04 Dec 2025 @ 02:00 PM (EST)
End-of-Year Event: Securing AI Transformation in a Hyperconnected World - AmericasWed 26 Nov 2025 @ 12:00 PM (COT)
Panama City: Risk Management a la Parrilla: ERM, TEM & Meat LunchAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY