Forum Discussion

Monty_Sinha_229's avatar
Monty_Sinha_229
Icon for Nimbostratus rankNimbostratus
Jan 23, 2017

iRule to down and up Pool members

Hi All,

I am trying to build an iRule for our Application Admins to be able to input a string on the uri of a vserver, and down the node they input, however I am not able to get a simple LB::down command working, doing a test with the below, it does not be causing the node to show as unavilable. Please note that we are using route domains, hence I have tried with a %3 aswell but does not work. I know that the if command words as I get the log entry but the LB::down does not work.

when HTTP_REQUEST {
  if {[scan [HTTP::uri] "/down/%s" server] == 1} {
log local0. "LB::server 10.42.136.221"
     LB::down pool ems_testing member 10.42.136.221 80
     log local0. "URI: [HTTP::uri] MATCHED. server=$server"
  } else {

  }
}

I am running build 11.6.1

Thanks Monty

4 Replies

  • LB::down will mark a member as down, however monitoring will proceed and the member will be marked up again as soon as it passes the monitor. Hacve to check the logs to see if the member is being marked as 'down', but then being marked as 'up' again?

     

  • This is not a good way to do it - better to create them a portal and use iControl to control members as up or down. However, you could also use a static variable that contains a list of servers that are not in use and check it on request. Not a good solution as you are likely to get unexpected results.