Cool beans. Another tool in your tool belt :) On Wed, Dec 8, 2010 at 7:56 PM, LJ LongWing <[email protected]> wrote:
> ** > > Axton, > > I took that suggestion and was able to put together a very simple servlet > that does a URL check > > > > URL url = *new* URL(URLs); > > HttpURLConnection connection = (HttpURLConnection) > url.openConnection(); > > > > the URL in question gets passed in through a config file, and then based on > various tests of the connection, I’m able to determine if the connection was > able to get to the home page or not, and throw a 500 error if it doesn’t. > Seems to be doing EVERYTHING I was looking for, thank you for your help on > this urgent matter for my company J > > > > *From:* Action Request System discussion list(ARSList) [mailto: > [email protected]] *On Behalf Of *Axton > *Sent:* Wednesday, December 08, 2010 1:01 PM > > *To:* [email protected] > *Subject:* Re: JSP to monitor functionality > > > > ** You could write a servlet to do the work like this: > > - Handle the incoming request > - Issue an HTTP request to the desired form/resource, create the > authentication context, etc. > - Parse the HTTP response headers for the response codes > > > - I use the plural "headers" because when you request a page like the > Home Page, you will get back many HTTP responses for things like css, > js, > etc. > - You will want to look at the response code for the original > request, e.g., /Home+Page/ > > > - Return the desired HTTP response code based on the response above > > This varies from the redirect approach, which will change the response to > a 301 or 302. Servlet is probably the more appropriate technology for > this, versus a jsp, though you can probably get either to work. > > > > On Wed, Dec 8, 2010 at 1:26 PM, LJ LongWing <[email protected]> wrote: > > ** > > That’s the problem, I can’t have the load balancer ‘log on’, they need a > URL that returns a 200 or 500 period. So I am looking for some automated > way to log on automatically on the back end and verify that everything is > functional, if it is, return a 200, if not, 500…and a redirect changes it > from a 200 so it won’t work > > > > *From:* Action Request System discussion list(ARSList) [mailto: > [email protected]] *On Behalf Of *Axton > *Sent:* Wednesday, December 08, 2010 11:47 AM > > > *To:* [email protected] > *Subject:* Re: JSP to monitor functionality > > > > ** Why not have the load balancer load the home page, authenticate, and > check the response code. If 200, then status is ok, if 500 series, then > fault the node. I assume that when the error below occurs in the mid-tier > logs, you are getting 500 responses in the browser. > > > > The response code is really easy to pick out of the http headers and it is > something that every web server will return will every http request. > > On Wed, Dec 8, 2010 at 11:15 AM, LJ LongWing <[email protected]> > wrote: > > ** > > I have recently been having issues where the Tomcat is ‘functional’ from a > Tomcat perspective, but you can’t log onto the app server, getting the > following error. What I’m trying to do is write a jsp that will see if a > URL ‘returns a value’…specifically I’m planning on using a login URL to get > to the home page with ID and PW pre-configured on the URL…..if that URL > loads fine, I need to have the JSP page return a 200, if not, something > else. This is for a load balancer that can’t currently tell if your server > is online or not. > > > > HTTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented it > from fulfilling this request. > > > > exception > > > > java.lang.ArrayIndexOutOfBoundsException > > java.lang.System.arraycopy(Native Method) > > > com.bmc.arsys.arrpc.rpcext.ArXdrTcpEncodingStream.getEncodedBuffer(Unknown > Source) > > com.bmc.arsys.arrpc.rpcext.ArXdrTcpEncodingStream.endEncoding(Unknown > Source) > > com.bmc.thirdparty.org.acplt.oncrpc.OncRpcTcpClient.call(Unknown > Source) > > com.bmc.arsys.api.arxdrenc.b.call(Unknown Source) > > com.bmc.arsys.api.session.c.a(Unknown Source) > > com.bmc.arsys.api.ProxyJRpcBase.a(Unknown Source) > > com.bmc.arsys.api.ProxyJRpcBase.arCall(Unknown Source) > > com.bmc.arsys.api.ProxyJRpc.ARVerifyUser(Unknown Source) > > com.bmc.arsys.api.ARServerUser.verifyUser(Unknown Source) > > com.bmc.arsys.api.ARServerUser.login(Unknown Source) > > com.remedy.arsys.session.LoginServlet.authenticate(Unknown Source) > > com.remedy.arsys.session.LoginServlet.doLogin(Unknown Source) > > com.remedy.arsys.session.LoginServlet.doThePost(Unknown Source) > > com.remedy.arsys.session.LoginServlet.doRequest(Unknown Source) > > com.remedy.arsys.stubs.GoatHttpServlet.postInternal(Unknown Source) > > com.remedy.arsys.stubs.GoatHttpServlet.doPost(Unknown Source) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:647) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:729) > > note The full stack trace of the root cause is available in the Apache > Tomcat/5.5.28 logs. > > > > > > *From:* Action Request System discussion list(ARSList) [mailto: > [email protected]] *On Behalf Of *Axton > *Sent:* Wednesday, December 08, 2010 10:02 AM > *To:* [email protected] > *Subject:* Re: JSP to monitor functionality > > > > ** Hit the mid-tier configuration page; if it loads, then the container/jvm > are working. If you want to go beyond that, create a jsp that performs the > desired checks and returns the output in a format that you can parse, like > xml. > > On Wed, Dec 8, 2010 at 10:45 AM, LJ LongWing <[email protected]> > wrote: > > ** > > I have an urgent need to be able see if our server is online through JSP. > Suggestions? > > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > > > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > > > > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > > > > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > _attend WWRUG11 www.wwrug.com ARSlist: "Where the Answers Are"_ > _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"

