Forum Discussion

Samadi's avatar
Samadi
Icon for Altocumulus rankAltocumulus
Mar 09, 2021

HTTP Monitor

Hi,

 

I want to set an HTTP monitor with the "Receive String" and the "Receive Disable String" so my application return the below results :

{"EXCEPTION":false,"RESULT":"{\"DBUp\":true,\"serverUp\":true}"} ==> app is OK

{"EXCEPTION":false,"RESULT":"{\"DBUp\":true,\"serverUp\":false}"} ==> app is not OK

{"EXCEPTION":false,"RESULT":"{\"DBUp\":false,\"serverUp\":true}"} ==> app is not OK

{"EXCEPTION":false,"RESULT":"{\"DBUp\":false,\"serverUp\":false}"} ==> app is not OK

 

my configuration is :

Receive String : (true.*true)

Receive Disable String : (DBUp\W{3}false)|(serverUp\W{3}false)

 

but this monitor is not working, any one can help please ?

 

Regards,

 

 

 

  • Your receive string should work, although the parenthesis are unnecessary in your regular expression. Try removing them to see if that makes a difference. If the monitor is still marking a pool member down, it most likely means the pool member is not returning the expected string. You should check the server's response payload to ensure it is producing what you expected. For additional information on troubleshooting LTM health monitors, you can refer to this article: K12531: Troubleshooting health monitors.

     

    To test regular expressions against various strings, I often use regex101.com.

    • Samadi's avatar
      Samadi
      Icon for Altocumulus rankAltocumulus

      thank you for your feedback, I tested my regular expressions and the server response it return the expected result.

       

      I will check the this article and I will back to you.

       

      thanks a lot.

    • Samadi's avatar
      Samadi
      Icon for Altocumulus rankAltocumulus

      Hi  

       

      it still the same issue, any idea please ?

       

      Regards,

  • Since all but one string indicates an "app is not OK" situation, why not write the monitor such that it simply checks for the one "app is OK" condition Receive String (whatever that string is), and let any other response naturally result in the health monitor check failing and the member eventually being marked down? Unless I'm missing some additional details that are not in your original question, it does not seem like you need a Receive Disable String on the monitor here. You do not need to describe all the false (not OK) conditions in a monitor to mark a resource as unavailable (down). You just need to define the one condition that produces the "success" result in the Receive String, and any other response is a "fail" result.

    • Samadi's avatar
      Samadi
      Icon for Altocumulus rankAltocumulus

      Hi  

      thank you for your feed back, I tried the options below but it do not work for me :

       

      Receive String : (true.*true)

      Receive Disable String : empty

       

      any idea please ?

  • Hi  

     

    thank you for your support, I have resolved the issue by changing my request.

     

    Regards,

    SAMADI Boukil