Forum Discussion

Ashish_R_G_2512's avatar
Ashish_R_G_2512
Icon for Nimbostratus rankNimbostratus
Jun 21, 2016

calling a tcl script inside another tcl script on f5

Hi,

 

I have a TCL script which will help me create pool. Now I am creating another tcl script for VIP creation and i want to call the pool creation script inside the VIP creation scripts.

 

is there any way to do that?

 

Thanks, Ashish

 

  • bwolmarans_1284's avatar
    bwolmarans_1284
    Historic F5 Account

    tcl 8.5 running on a laptop or using tcl on the bigip? generally, you can use the command "source". But I'm not sure that would be what you want. Please post your scripts and we can take a look.

     

    • Ashish_R_G_2512's avatar
      Ashish_R_G_2512
      Icon for Nimbostratus rankNimbostratus
      on bigip. i'm not sure about the tcl version. the script is huge. i'll post the part which i had error. proc script::run {} { set poolname [lindex $tmsh::argv 3] foreach {pool} [tmsh::get_config \ltm pool] { if {[tmsh::get_name $pool] ne $poolname} { puts "====================================================================" puts "$poolname not found \n" puts -nonewline "Do you want to create this pool?(Y/N): " flush stdout set createpool [gets stdin] if {$createpool eq "Y"} { tmsh::run cli script scriptname.tcl } Thanks in advance. :)
  • I am assuming you are talking about a TCL script running on a separate server/computer and not the iRule. You probably need "source" or "exec" for it depending on your requirements. I would also recommend exploring the option of using a master bash script that calls multiple TCL scripts.