Forum Discussion

soymanue's avatar
soymanue
Icon for Nimbostratus rankNimbostratus
Jun 08, 2012

Forcing node off in all the pools

Hello

 

I want to create a script to force a node offiline in all the pools it belongs to.

 

How would you modifidy this example ?

 

https://devcentral.f5.com/wiki/TMSH.DeletePoolMembers.ashx

 

 

01: proc script::run {} {

 

02: if { $tmsh::argc "

 

04: } else {

 

05: set poolstring [lindex $tmsh::argv 1]

 

06: set len [expr { [string length $poolstring] - 1 }]

 

07: }

 

08: foreach {pool} [tmsh::get_config /ltm pool] {

 

09: if { [string range [tmsh::get_name $pool] 0 $len] equals $poolstring } {

 

10: tmsh::delete ltm pool [tmsh::get_name $pool]

 

11: }

 

12: }

 

13: }

 

14: proc script::help {} {

 

15: tmsh::add_help "Delete a list of pools beginning with specified string\n\

 

16: "

 

17: }

 

 

Before working on the script, I've tried with a single command. As we have partitions, it hasn't worked

 

 

 

tmsh modify ltm pool /Unix/XPA_448 members modify { 192.168.1.3:448 {state user-down}} 01020036:3: The requested pool member (/Unix/XPA_448 /Unix/192.168.1.3 448) was not found.

 

 

tmsh modify ltm pool XPA_448 members modify { 192.168.1.3:448 {state user-down}} 01020036:3: The requested pool (/Common/XPA_448) was not found.

 

 

Can anybody help with any of both issues (script or single command)?

 

Thank you

1 Reply

  • Hi Manuel,

     

     

    You can just disable the node address and the pool member will be disabled across all of the pools it's in. You don't want to actually delete the pool members.

     

     

    Aaron