Forum Discussion

Ricardo_77091's avatar
Ricardo_77091
Icon for Nimbostratus rankNimbostratus
Mar 26, 2009

HTTP Monitor that follows redirects

We are trying to configure an HTTP monitor to monitor a .NET application and mark the member as down if it does not receive the response it expects. The problem is that the first response is a 401 Unauthorized. By putting 401 Unauthorized in the receive string we can cover the service being down, website stopped, or application pool unavailable. However, it does not cover us for when we receive 500 server errors as they are returned after the 401 Unauthorized.

 

 

Does anyone have a suggestion as to how we can do this using a simple HTTP monitor, or if necessary, an irule/ECV ?

27 Replies

  • OK well getting better. I realized that there were hard returns and tabs at end of lines 3 and 5 and 11 in my previous post of results.

     

     

    BUt now I got one last weird one ... so close ... I get unexpected EOF!

     

    [admin@dmzlb1:Active] ~ sh -x /usr/bin/monitors/NTLM_Auth_Intranet 10.10.185.39 80

     

    ++ echo 10.10.185.39

     

    ++ sed s/::ffff://

     

    + IP=$'10.10.185.39\r'

     

    + PORT=$'80\r'

     

    ++ basename /usr/bin/monitors/NTLM_Auth_Intranet

     

    + PIDFILE=$'/var/run/NTLM_Auth_Intranet.10.10.185.39\r_80\r.pid\r'

     

    /usr/bin/monitors/NTLM_Auth_Intranet: line 22: syntax error: unexpected end of file

     

     

    There is no line 22! And there are no returns or any characters after "exit" on line 21 .... weird!

     

     

    Its like its expecting something else ....
  • Do you guys use any special scripting development tool?

     

     

    I am just using Notepad ... should be fine I figured.
  • OK I ran another test. If I take the "exit" out of the last line, line 21, I get the same thing, unexpected EOF.

     

     

    Its like I need something to terminate the script or something. Any ideas?
  • Ok I figured out my issue. It was not working with Notepad. I copied the script over to the LTM using WinSCP and then opened with pico and edited the file. Now it works.

     

     

    So I should have just used LInux editor to begin with. My noobescence is showing.

     

     

    Thanks for all the help guys.
  • That's some good perseverance. I'm glad you got it working and shared the solution.

     

     

    Aaron
  • Yeah Notepad is usually the worst offender when it comes to mangling Unix-style scripts...

     

     

    Denny