Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

tmsh script and pool members

Hi,

Probably easy one but not for me :-(

I am looking for simplest and fastest way to verify settings of pool member in given pool/s - for example description. Right now I have such code that is working but maybe there is simpler way?

set pool_names [lrange $tmsh::argv 1 end]

foreach pn1 $pool_names {
    foreach obj1 [tmsh::get_config /ltm pool $pn1] {

        puts $obj1
        tmsh::modify /ltm pool $pn1 description "Orange"
        tmsh::log "Description is [tmsh::get_field_value $obj1 description]"

        foreach member1 [tmsh::get_field_value $obj1 members] {

            puts $member1
            puts "Pool member desc: \"[tmsh::get_field_value $member1 description ]\""

        }
    }
}

puts are just for testing of course. So last puts returns description for each pool member in a pool.

What puzzles me as well is why after using tmsh::modify /ltm pool $pn1 description "Orange" tmsh::log reports previous value. After script is finished value is set to "Orange" but inside script even after modify old value is reported.

I assume as well that there is no need for tmsh save sys config to permanently save changes?

Piotr

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

modify in tmsh modifies only the running config, you do need to save your changes to impact the startup config.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi Jason,

Nice to hear from you. I am a bit surprised that config save is necessary - o\in all examples I checked no config save is present or mentioned (like in your example Build GTM Configuration).

So last line in the script should be:

tmsh::save sys config

What about value modification not reported in script but reflected in config after script is finished - is that normal?

I am pretty sure that for below sequence (when pool description was initially "Red")

puts [tmsh::get_field_value $obj1 description] tmsh::modify /ltm pool $pn1 description "Orange" puts [tmsh::get_field_value $obj1 description]

script output was Red Red

but then when I checked description it was set to Orange.

Piotr

0