Forum Discussion
4 Replies
Hi,
When using bash, you can do the following :
tmsh list ltm node > output.txt
- tatmotivCirrostratus
Calling tmsh commands directly from bash like Yann suggested is suitable in most cases, but might involve problems when using partitions. Another way to accomplish this would be starting an interactive tmsh as normal, but piping its output to file via tee like this:
bash> tmsh | tee myoutput.txt root@(my_lb)(cfg-sync In Sync)(/S1-green-P:Active)(/Common)(tmos) cd /PA999-Test1/ root@(my_lb)(cfg-sync In Sync)(/S1-green-P:Active)(/PA999-Test1)(tmos) list net self net self FLOATIP-VLAN4091 { address 10.44.55.250/24 floating enabled partition PA999-Test1 traffic-group /Common/TG999-Test1 unit 2 vlan VLAN4091 } net self FLOATIP-VLAN4092 { address 10.22.33.240/24 floating enabled partition PA999-Test1 traffic-group /Common/TG999-Test1 unit 2 vlan VLAN4092 } net self SELFIP-VLAN4092 { address 10.22.33.238/24 partition PA999-Test1 traffic-group /Common/traffic-group-local-only vlan VLAN4092 } net self SELFIP-VLAN4091 { address 10.44.55.248/24 partition PA999-Test1 traffic-group /Common/traffic-group-local-only vlan VLAN4091 } root@(my_lb)(cfg-sync In Sync)(/S1-green-P:Active)(/PA999-Test1)(tmos) quit <--- back to bash [root@my_lb:/S1-green-P:Active:In Sync] config [root@my_lb:/S1-green-P:Active:In Sync] config [root@my_lb:/S1-green-P:Active:In Sync] config ls -lah myoutput.txt -rw------- 1 root root 1.2K Jun 3 11:42 myoutput.txt <--- This file contains all of your tmsh session
- computerliAltostratus
Not sure why every answer points to using the bash. The question is to pipe command output to file from tmsh. If its not possible, please say so
- DavisLiEmployee
I believe you can do so in bash mode. But if you want to output tmsh elements, you can run below command:
For example, I wanted to save the hardware information of this appliance:
Running in bash mode: ("run util bash" if you get stucked in tmsh mode)
tmsh show /sys hardware > /shared/tmp/hardwareinfo.txt
You can extract this text file from the designated directory you set above.