WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Checking URL status with Jython

    Posted Thu January 26, 2012 02:00 PM
    is it possible to check an URL status/content with help of  jython script. We have loadbalancer sitting in front of appservers an serving requests. Before stopping cluster members, i would like to check status of bigIP and if BigIP status is marked down only, i would be able to stop cluster members. Could this be done through jython  ?


  • 2.  Checking URL status with Jython

    Posted Thu January 26, 2012 04:34 PM
    Srikanth,

    What is the configuration of the BigIP device in front of the WebSphere system?  Most times there's a web server between the F5 load balancer and the WebSphere system.  Are you routing traffic directly to the WebSphere cluster members (using ports?)

    Next, can you elaborate on what you mean by BigIP marking the cluster member as down? From my experience, when something like an F5 marks a system as down, it's actually down/ not responding.  Or are you calling out that if the BigIP device is down and thus not routing to your cluster any more?

    Finally, if your using WAS ND, are you using session persistance and is it transferable to other cluster members?  If not, you might run into some nasty situations.

    Erik


  • 3.  Checking URL status with Jython

    Posted Thu January 26, 2012 04:51 PM
    Srikanth 

    Tell  me, if my understanding is corect.

    You like to check if the websphere JVM has been marked as down or not in BigIP before you actually stop the JVM. Because.. you are concern is if the loadbalancer didn't mark the JVM as down... it may send requests to that JVM.

    So, you like to check the status of the JVMs in the BigIP.  


  • 4.  Checking URL status with Jython

    Posted Thu January 26, 2012 05:27 PM


    Requests are being forwarded directly from BigIP to Appserver. We dont have any applications which have session persistance. 

    Secondly, the way bigIP checks if an appserver is up or not is by accessing a static URL which we have deployed as an application on each cluster member. Static URL produces a string either "Server UP" or "Server Down ". If the response from Static URL is not "Server Up", big marks the JVM down.  In a cluster, there could be multiple JVM's , so i am trying to check just bigIP URL rather than going to each individual JVM and checking for its status.


    BigIP URL : abc.com/checkJVM.jsp

    If the response from URL is "Server UP" , i wouldnt like to stop cluster but if the response from URL is "Server Down, then i would like to bring down the cluster. I have wsadmin scripts which do stopping/starting clusters.

    The reason for my approach is basically avoid any human errors. Let me give a simple example- We have applications across datacenters.Sometimes during deployments, we come across situations where have livetraffic being handled by one datacenter ( ex: Datacenter A ) and we are supposed to deploy application on other center (ex: Datacenter B) and by mistake we end up stopping traffic on datacenter A causing an outage.

    Please let me know if this gives an idea at what i am trying to accomplish.



  • 5.  Checking URL status with Jython

    Posted Thu January 26, 2012 07:10 PM
    i think 'wget' on the bigIP url should tell you the status. 

    on unix/linux systems
    wget abc.com/checkJVM.sp

     


  • 6.  Checking URL status with Jython

    Posted Thu January 26, 2012 08:06 PM
    Joseph,

    Thanks for the response. I have used python urlib function to accomplish this but wanted to see if we could accomplish through jython and secondly wget is also a possible solution . We have a single script for accomplishing most of the websphere operation functions and would like to include this feature also in that. Any help regarding this matter would be greatly appreciated. 


  • 7.  Checking URL status with Jython

    Posted Fri January 27, 2012 08:44 AM
    Admittedly, this is not my area of expertise.  

    It appears that WebSphere 6.1 and higher implimented JYTHON v2.1.  If jython v2.1 has a urllib package, than you may be able to accomplish what your looking to do with an equivalent function such as urlopen() that is available in later version of jython.

    Again, this isn't my area of expertise so I'm unsure if there is a urllib package or function that you could use with jython v2.1...

    If there is, this would allow you to continue to use your jython script and query the page through the BigIP device.

    Finally, uness I'm mistaken, you are NOT looking to run the script on the BigIP device.  You simply want to query the device from within an existing jython script.  Correct?

    Erik