Forum Discussion

shan_83900's avatar
shan_83900
Icon for Nimbostratus rankNimbostratus
Jun 17, 2009

list of active members in BIG-IP 9.3.0

How can I get a list of active members in a pool in BIG-IP version 9.3.0.

 

I cannot use active_members -list .

9 Replies

  • Unfortunatly with v9.3.0 you can only get the of active members in a pool.

     

    However, you could probably write something that can possible provide active list

     

     

    Example

     

     

    set GOOD_NODES {}

     

    set NS {192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4}

     

    foreach N $NS {

     

    if { [LB::status pool poolnodes member $N 80] eq "up" } {

     

    lappend GOOD_NODES $N

     

    This will append only the good news to an array to produce a list of active nodes

     

    }

     

    }

     

     

     

     

    Hope this helps,

     

    CB
  • In addition to CB's good suggestion, depending on what you're trying to do you might be able to use LTM's default pool selection to accomplish it. If you provide more detail we might be able to provide another suggestion.

     

     

    Aaron
  • Thanks CB and Aaron!!

     

     

    I am not sure what additional information you want?

     

     

    Check this out if, this is something you are looking for:

     

     

    BIG-IP LTM 6400 (VFNQDKG-QZDJYZG)

     

    BIG-IP LTM (VTELNYB-NTACBUI)

     

     

    * Add Compression 5 Mbps

     

    * Add SSL 100 TPS

     

     

    Related to my question:

     

    I want to select next active member from current pool, if, response for a request is not in 2XX or 3XX.

     

    So I select next active member and redirect request to next active member.

     

     

    This is the iRule, I wrote to before I figured that I cannot use list option with active_members:

     

     

     

    when HTTP_RESPONSE {

     

    if { [HTTP::status] starts_with "2" or [HTTP::status] starts_with "3" } {

     

    } else {

     

     

    set query [HTTP::header value Referer]

     

     

    log local0. "query: $query"

     

     

    set propertyName [URI::query [HTTP::header value Referer] "propertyName"]

     

     

    log local0. "propertyName: $propertyName"

     

     

    log local0. "active members: [active_members -list [LB::server pool]]"

     

     

    set picked [lindex [active_members -list [LB::server pool]] 0]

     

    log local0. "picked: $picked"

     

     

    set host [lindex $picked 0]

     

    log local0. "host: $host"

     

     

    set port [lindex $picked 1]

     

    log local0. "port: $port"

     

     

    set url "http://$host:$port/pageNotFound.action"

     

    log local0. "url: $url"

     

     

    if { $propertyName ne "" } {

     

    HTTP::redirect "$url?propertyName=$propertyName"

     

    } else {

     

    HTTP::redirect "$url"

     

    }

     

    }

     

    }

     

  • Is your goal for the irule to simply move the connection over to the next active member when a node is down?

     

     

    CB

     

  • Actually not only when a node is down, but, always if we get response code other than 2XX or 3XX.
  • Well if you are looking for a response other then 2xx ro 3xx the active_members function is not going to work because it's basing that off a health check. What you would need to probably is determine which server is throwing the status beyond 2xx or 3xx and simply choose another node to send the traffic to.

     

     

  • Yes!! that's what is the plan.

     

    Actually I was about to use active_members command to get list and select a node other than the one which is sending non 2xx and 3xx responses.

     

    Anyways thanks a lot everyone, this was great help and really appreciate your help.

     

    Now we decided to upgrade to new versions so we are gud.
  • Keep in mind that that v9.3.x is a maintanence branch and v9.4.x is feature branch. The idea is that maintanence branches are more about stability then having releasing features.

     

     

     

    CB

     

  • You could use LB::down (Click here) to mark the current pool member (or node) down if it responds with a non-2xx or 3xx response and then reselect a new member. Keep in mind that you Would probably only want to consider marking the server down if it responds with a 5xx error. A 4xx level response indicates a client error--not a server error. So you could find yourself DOS'd if a search engine or malicious user simply requested objects which don't exist in your application.

     

     

    Aaron