Forum Discussion

emily_74156's avatar
emily_74156
Icon for Nimbostratus rankNimbostratus
Oct 13, 2009

select different monitor based on context root

How do I create an irule so that different context root uses different monitor. Such as

 

 

http://www.myhost.com/app1 uses mon1

 

http://www.myhost.com/app2 uses mon2

 

 

etc.

 

10 Replies

  • You cannot assign "monitors" within an irule based on content.

     

     

    Can you provide more details on what you want to do? Are you trying to send traffic to servers based on what is within the monitor?

     

     

    CB

     

  • If you simply want to monitor app1 with a different monitor than app2, you can define two pools: app1_http_pool and app2_http_pool and assign a relevant monitor for each pool.

     

     

    If that's not what you're thinking, can you, as CB suggested, provide more info on what you're trying to accomplish?

     

     

    Aaron
  • 1. I can't define 2 pools based on the requirements we have.

     

     

    2. The reason I need 2 monitors for app1 and app2 respectively is that there is no general monitor I can use which tells me the backend server status for /app1 and /app2.

     

     

    3. Think about app1 and app2 are 2 apps running on the both server1 and server2 in the backend. So I need an irule or sth to help me figure out the backend server status for /app1 and /app2. So that if server1 is down for /app1, LTM will send traffic to server2 for /app1. But for /app2, if server1 is availabe, so LTM can send traffic to server1.
  • Why couldn't you create two different pools if it's two different web apps? The IP:port for both pools would still be identical. This would just allow you to monitor, load balance and persist requests separately depending on which app the request was being made to.

     

     

    Aaron
  • To answer your question - there is an webserver between the app server and the LTM. So, LTM is loadbalancing the webservers, and webservers send requests to app servers. That's why we only need 1 pool, which as 2 webservers in the back. And the 2 webservers talk to the app servers respectively.
  • Here is a thought. What if you let the LTM load balance the APP Servers for the webservers.

     

     

    For example

     

     

    web_server_vip ---> Pool A (Web Server 1 and Web Server 2)

     

     

    app1_vip --> Pool A (Server1App1 and Server2App1)

     

    app2_vip --> Pool B (Server1App2 and Server2App2)

     

     

    Such that you are monitoring APP1 and APP2 respective of their pools, which allows you to monitor each instance

     

     

    Then have Web Server 1 or 2 access their respective appX vips.

     

     

    In theory if Server1App1 fails the monitor, then the requests from Web Servers would go to Server2App1 and allows web server to access app2 on server1.

     

     

     

    I hope this helps

     

    CB

     

     

     

     

  • CB,

     

     

    You really get my point now! The approach you proposed was actually tried by us last week, but didn't quite work out due to some application limitations.

     

     

    Down to the bottom, there is no way I can write an irule to select different monitor based on different uri??
  • Correct, there appears to be no way to select a different monitor via irule. However, what was the app limitation? Are they using the same port?

     

     

    CB
  • CB,

     

     

    Thanks for the response. It's hard to explain the app limiatation here. But you've answered my question - if irule can't do that, we'll need to figure out from the app side.

     

     

    Thanks!