Jump to content
Welcome to our new Citrix community!

HTTP-ECV Monitor / How can I add HTML body?


Recommended Posts

Hi guys,

 

I have been asked to create a HTTP-ECV Monitor, this one is pretty special because I need to use a BODY HTML to get the right answer (string). See example bellow 

 

Example NOK : no BODY using Postman

 

20201127_aiBodyNOK.thumb.png.27834c72b9c342b4b944b882bae36472.png

 

Exemple OK: custom BODY using Postman

 

20201127_aiBodyOK.thumb.png.a70866fb8e28958855bf65d4487fb234.png

 

I searched around but couldn't find answer. Could you please give me a hand? It will be very appreciated :)

 

Thank you

 

Matt

PS: Yes I know, If I want to monitor HTTP code I could use a simple HTTP monitor but unfortunately I have been challenged to find another way regarding this application

 

 

Link to comment
Share on other sites

To verify the BODY is being generated, you need to use the http-ecv monitor to search for a string that is present in the body portion of the response.

You can use the http monitor (monitor1) to confirm the status code 200  (OK) is received.  Use an HTTP monitor with HEAD /health and receive string and confirm 200 response code received.

 

Use a separate http-ecv monitor (monitor2) to search for Get /somepage.asp and then use the receive string to confirm a string in the actual BODY content. Searching for the 200 OK header isn't going to confirm the body was generated.  The receive string is a simple string comparison and case sensitive.

 

 

Link to comment
Share on other sites

On 11/27/2020 at 5:55 PM, Daniel Weppeler1709159306 said:

Hey,

 

Have you tried this configuration? It's only an example because I don't know about path and secure parameter. 

image.thumb.png.3d2d91a00cbbf28c52d8c7414a06ebd1.png

 

CLI Command:

add lb monitor LBMON_AppHealth HTTP-ECV -send "GET /health" -recv "<status-code>200</status-code>" -LRTM ENABLED 

 

Cheers,

Daniel

 

Hi Daniel,

Thank you for your answer.

Well, your solution will work like a normal HTTP-ECV monitor IF I COULD fill the http body into the send string request :( (see picture1 I uploaded)

Link to comment
Share on other sites

On 11/30/2020 at 12:32 AM, Rhonda Rowland1709152125 said:

To verify the BODY is being generated, you need to use the http-ecv monitor to search for a string that is present in the body portion of the response.

You can use the http monitor (monitor1) to confirm the status code 200  (OK) is received.  Use an HTTP monitor with HEAD /health and receive string and confirm 200 response code received.

 

Use a separate http-ecv monitor (monitor2) to search for Get /somepage.asp and then use the receive string to confirm a string in the actual BODY content. Searching for the 200 OK header isn't going to confirm the body was generated.  The receive string is a simple string comparison and case sensitive.

 

 

 

Hi Rhonda,

Thank you for your answer. 

 

Usually, I would use a normal HTTP monitor to make sure the server status code is 200 (or anything else OK). However, the GET or HEAD request brings errors to their console so they challenge me to find another way. 

Otherwise, If a webserver has a dedicated monitoring page like /healthcheck /status /... I will use a HTTP-ECV and monitor a specific receive string.

 

That's what I want to do now, but I need to send a string with a specific body to get the right answer... This might be not possible but I'm still looking for a solution ;)

Link to comment
Share on other sites

So is the issue that you need to look at a specific body in the monitory response OR that you are trying to send a body in the probe REQUEST?

 

You might have to do a POST instead to submit a body as the monitor request.  (Which I don't know if this monitor can do or not without testing.)

Or you might have to do it as an tCP or TCP-ecv monitor which can take more details in the send vs receive packets.

 

Remember the send string is the request you are submitting that the probe is based on.

The receive string is what the probe needs to see as valid to be a success. For HTTP monitor, the receive is a header status code only. For http-ecv, the receive is a string found in the body.

Link to comment
Share on other sites

  • 2 months later...
On 11/30/2020 at 5:02 AM, Rhonda Rowland1709152125 said:

To verify the BODY is being generated, you need to use the http-ecv monitor to search for a string that is present in the body portion of the response.

You can use the http monitor (monitor1) to confirm the tellpizzahut status code 200  (OK) is received.  Use an HTTP monitor with HEAD /health and receive string and confirm 200 response code received.

 

Use a separate http-ecv monitor (monitor2) to search for Get /somepage.asp and then use the receive string to confirm a string in the actual BODY content. Searching for the 200 OK header isn't going to confirm the body was generated.  The receive string is a simple string comparison and case sensitive.

 

 

Very Helpful Post .......!! thanks for sharing with us.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...