Forum Discussion

tatmotiv's avatar
tatmotiv
Icon for Cirrostratus rankCirrostratus
Feb 23, 2017

iApp: determine tmos version

F5 had the brilliant idea to change the options of the

"tmsh save sys config file"
command between version 11.6 and 12.x. Before 12.x, you could issue that command as follows:

V11.6.0 HF6:

(tmos) save sys config file /var/tmp/test.scf
Saving running configuration...
  /var/tmp/test.scf
  /var/tmp/test.scf.tar

In 12.x, to achieve the same result, you MUST add the option "no-passphrase", otherwise the command will not execute.

V12.1.2:

(tmos) save sys config file /var/tmp/test.scf
Data Input Error: "passphrase" passphrase should be provided or use the no-passphrase option
(tmos) save sys config file /var/tmp/test.scf no-passphrase
Saving running configuration...
  /var/tmp/test.scf
  /var/tmp/test.scf.tar

Unfortunately, I have an iApp running on all my big IPs that executes this command (and others) for backup purposes. This iApp crashes on systems being upgraded to 12.1.2 because of the missing option. If I add the option to the iApp, it will crash on 11.6.0 because the option does not even exist there:

V11.6.0 HF6:

(tmos) save sys config file /var/tmp/test.scf no-passphrase
Syntax Error: "no-passphrase" unknown property

Great job, f5!

Now, if I want to have a universal iApp on all systems, I need to include a function that determines the running tmos version and issue different tmsh commands depending on whether it is <12 or not. I have no idea how to do that in an iApp. Has anybody done something like that before and can put me into the right direction? Many thanks in advance!

Regards Martin

1 Reply

  • Hi, thank you for sharing that new behavior.

    I think you can do it by checking
    [tmsh::version]
    .

    Regards.