Forum Discussion

Logan_Ramirez_5's avatar
Logan_Ramirez_5
Icon for Nimbostratus rankNimbostratus
Mar 12, 2010

schedule maintenance?

Hello.

 

 

We are looking for a way to 'schedule maintenance' and have the LTM automatically remove pool members between X and Y time values. The key here is automation.

 

 

The way we are thinking of implement this is as follows:

 

- We already have a custom aspx for monitoring our websites.

 

- The aspx run on the web server (being monitored) and checks the database connections. If all is peachy, it replies with text ("successfull!")

 

- If the string 'successful' is matches in the http monitor, then the node is UP.

 

 

Simple enough. Works great. We love it.

 

 

Now, the creative thought today was 'could the f5 do different things based on that text?'

 

 

For example, what if we sent back 'maintenance' as the return string - is there a way to use that in an iRule?

 

 

Obviously the monitor is boolean so I do not expect to get this from monitoring, but anyone know of iRule logic to evaluate the input from a custom aspx?

 

 

4 Replies

  • Hi Logan,

     

    I am afraid you can really manipulate the monitor in anyway directly from an iRule.

     

     

    If you are looking to do a maintenance then my suggestion is looking at the Codeshare: (Click here).

     

     

    Here are some examples found on the Codeshare

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePage.html

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePageGenerator.html

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePageLite.html

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenanceWindow.html

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/LTM_sorry_page_image_when_no_pool_members_available.html

     

     

     

    I hope this helps

     

     

    Bhattman

     

     

  • You're confusing me because in the beginning of the post you say you want to do this between x & y time vaules... but the end of your post doesn't reflect that..

     

     

    I'm not sure how you would go about that.. you would have to pull a time vaule somehow... and if your time was >= etc then you could possibly redirect to x pool.. so maybe the asnwer is to include the time in your aspx page... and key on that vaule..

     

     

    bhatman took it as you were focused on the monitor.... and he is right.. you can't manipulate the monitor from the iRule..

     

     

    Though, you can definitley base your traffic on the iRule and redirect your traffic appropriately based on the response from your server...
  • Apologies on the confusion, IRuleYou. They are one and the same - both are relevant to my thinking (a) evaluate input from a custom aspx (text that comes back) then (b) make a decision between X and Y.

     

     

    Perhaps I should have created two separate posts (to avoid the confusion) but from all the posts I have read 'the big picture' is usually relevant and often folks (like you!) have a far better solution than what us rookies are thinking!

     

     

    For clarity, I certainly do not want to 'manipulate the monitor' but just 'read the result' - or, I was thinking of 'calling the monitor' from the irule (to get the result). The word 'manipulate' is a bit invasive and I wanted to be sure I was communicating this properly.

     

     

    Those links (Thanks, Bhattman!) really showcase the flexibility of the LTM (to host the down page! nice!) and I appreciate the guidance.

     

     

    I still can't figure out the 'between X and Y' portion of this, but have plenty to work with now. Another leading thought for this project is to build the time values in the aspx itself (in other words, just make the f5 monitor fail between X and Y by sending back the wrong text to the LTM, we'd write the aspx to monitor a backend database where we could set the X and Y flags) - so rather than build the logic in the LTM via irule, just 'down the nodes' by making the monitor fail at our discretion.

     

     

    We're still kicking the idea around...

     

  • You got it, I think you'll have better luck setting the time values in your aspx page and keying in on that..