Forum Discussion

tiwang's avatar
tiwang
Icon for Nimbostratus rankNimbostratus
Mar 07, 2014

Status flag on virtual server set to green?

hi out there Probably a simple question but I am out of ideas right now - in the GUI for ltm and various other Things there is often a status flag - either red - blue og green. On a vs in the ltm this flag is changed to green when I apply a default pool where at least one member is online - if I don't apply a default pool for it it keeps blue - unknown - how can I let this status flag reflect the status of a pool which is not a default pool? best regards /ti

 

5 Replies

  • Hi mate!

     

    Pools can be chosen via ie default pool, irules, http classes. You need to have a pool connected to the VS in one way or another to show the green flag. I believe the flag will always be green if one or more pools that's associated with the vip in one way or another has available members.

     

    /Patrik

     

  • tiwang's avatar
    tiwang
    Icon for Nimbostratus rankNimbostratus

    hi patrik yes but if I assign a pool trough a irule - is the status then reflected to the GUI? I had a similar setup with another vs where we assign the pool through a irule

    when HTTP_REQUEST { Log debug messages to /var/log/ltm? 1=yes, 0=no. set host_debug 0

    Need to force the host header replacement and HTTP:: commands into the clientside context as the HTTP_REQUEST_SEND event is in the serverside context

     if {$host_debug}{log local0. "[HTTP::host]: [HTTP::method] request to [HTTP::host][HTTP::uri]"}
    
       Look up the selected server name in the datagroup to get the right pool
      set pool_name_value [class match -value [HTTP::host] equals /dk_dmz/DK_AE_IP_pools_dg]
    
      if {$host_debug}{log local0. "[IP::client_addr]:[TCP::client_port]: Looked up [HTTP::host], found: $pool_name_value."}
    
       Check if the lookup returned a value
      if {$pool_name_value ne ""}{
    
          Replace pool
         pool $pool_name_value
         if {$host_debug}{log local0. "[HTTP::host]: Replaced default pool with $pool_name_value."}
      }
    

    }

    but this is not refelcted here ?

  • tiwang's avatar
    tiwang
    Icon for Nimbostratus rankNimbostratus

    ok - do you have a quick sample of how it could looke? I have f.ex a pool of name website-pool and want to assign this through a irule to an incoming client which has requested https://www.website1.com - would this look like this then:

     

    when HTTP_REQUEST { if { [HTTP::uri] contains "website1" } { pool website-pool } else { pool all_pool } }

     

  • Yeah but instead of HTTP::uri you should use HTTP:host. I would also use equals instead of contain as it uses less CPU. :)

     

    /Patrik