Forum Discussion
10 Replies
- samstepCirrocumulus
The best thing to do is to use tmsh sys config merge function, for which you need to make sure the text of irule in the file start from "ltm rule ..." e.g:
ltm rule hello_world { when RULE_INIT { log local0. "HELLO WORLD!" } }
e.g. save this in hello_world.txt file, now you can verify it and "load merge" it:
First verify:
tmsh load sys config verify file hello_world.txt merge Validating configuration... hello_world.txt
now merge for real:
tmsh load sys config file hello_world.txt merge Loading configuration... hello_world.tcl
That's it!
- samstepCirrocumulus
Hi vvc, you are probably running the tmsh command in a wrong order? make sure the "file " are used together - otherwise you would get the "unknown property" error.
try this:
Regards, Sam
- nitass_89166Noctilucent
do the files upload into the F5 as .tcl files? As in, after a successful upload/merge of the .txt file, can I call it as a .tcl file?
you can use whatever file extension you want.
- vvc5042_164605NimbostratusSorry, I think I was unclear. My trouble is that once I uploaded my tcl script as a .txt file, how do i open it? I began my script in the .txt as cli script VS_name.tcl{ .... } merge it successfully and then try to run it using run cli script VS_name.tcl or run cli script VS_name.txt both returns The requested script (/Common/VS_procs.tcl or .txt) was not found. So now i've uploaded the script but not able to open it.
- nitassEmployee
do the files upload into the F5 as .tcl files? As in, after a successful upload/merge of the .txt file, can I call it as a .tcl file?
you can use whatever file extension you want.
- vvc5042_164605NimbostratusSorry, I think I was unclear. My trouble is that once I uploaded my tcl script as a .txt file, how do i open it? I began my script in the .txt as cli script VS_name.tcl{ .... } merge it successfully and then try to run it using run cli script VS_name.tcl or run cli script VS_name.txt both returns The requested script (/Common/VS_procs.tcl or .txt) was not found. So now i've uploaded the script but not able to open it.
- nitassEmployee
I began my script in the .txt as
cli script VS_name.tcl{
....
}
i thought you are importing configuration (not tmsh scripting).
the following is an example when importing from terminal. anyway, configuration formatting is same.
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule test 01020036:3: The requested iRule (test) was not found. root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) load sys config from-terminal merge Enter configuration. Press CTRL-D to submit or CTRL-C to cancel. ltm rule test { when CLIENT_ACCEPTED { log local0. "" } } Loading configuration... root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule test ltm rule test { when CLIENT_ACCEPTED { log local0. "" } }
by the way, do not forget to save (tmsh save sys config) after importing.
- vvc5042_164605NimbostratusHi, thanks for the reply and yes that was my original question with the iRules. But I am trying the same method with a tmsh script, as in uploading a tmsh script from a .txt file to the F5 using the same method as I was uploading the iRule.
- nitass_89166Noctilucent
I began my script in the .txt as
cli script VS_name.tcl{
....
}
i thought you are importing configuration (not tmsh scripting).
the following is an example when importing from terminal. anyway, configuration formatting is same.
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule test 01020036:3: The requested iRule (test) was not found. root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) load sys config from-terminal merge Enter configuration. Press CTRL-D to submit or CTRL-C to cancel. ltm rule test { when CLIENT_ACCEPTED { log local0. "" } } Loading configuration... root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule test ltm rule test { when CLIENT_ACCEPTED { log local0. "" } }
by the way, do not forget to save (tmsh save sys config) after importing.
- vvc5042_164605NimbostratusHi, thanks for the reply and yes that was my original question with the iRules. But I am trying the same method with a tmsh script, as in uploading a tmsh script from a .txt file to the F5 using the same method as I was uploading the iRule.