CSS Http keepalive general failure

Answered Question
May 29th, 2009
User Badges:

Guys,

I need some advice on what could be wrong with the following scenario.

CSS 11503 is configured to monitor a server with HTPP Keealive with HEAD method expecting 200 OK message from specific page (URL):

service Server1

ip address 172.17.249.22

keepalive uri "http://www.server1.bg"

keepalive type http

keepalive port 80

protocol tcp

active


And i can't get this service to be Alive

i only receive: Keepalive Error: General failure

Meanwhile if i change the keepalive type to ICMP or tcp on port 80 the Service goes Alive.


Can you point me how I can debug where's the problem and a possible reasons.


Thanks

Correct Answer by sachinga.hcl about 8 years 1 month ago

As you are getting response code as


400 - Bad Request

The syntax of the request was not understood by the server.


So if possible created a webpage under root directory of web server, and confgured the "keepalive uri" point to that page. and i hope it will work.



Do some modifications as suggested follows as might it help your configuration to come up

service Server1

ip address 172.17.249.22 keepalive method head

keepalive uri "http://www.server1.bg" ---- > remove http from this line

keepalive type http

keepalive port 80

protocol tcp ----- >remove this line

active



You can try to add "keepalive type http non-persistent" command and see if it works.

service Server1

ip address 172.17.249.22

keepalive method head

keepaliveport 80

keepalive uri "//www.server1.bg" --- > or change the uri page to some other in the root directory if possible.




Enter the content information for a URI as a quoted text string with a maximum length of 64 characters. Do not include the host information in the string. The CSS derives the host information from the service IP address and the keepalive port number.


keepalive type http

keepalive type http non-persistent

active


If it doesn't work then please post the output from the following commands....


CSS# llama

CSS(debug)# icp probe service server1 "http://www.server1.bg"

CSS(debug)# icp probe host 172.17.249.22 "http://www.server1.bg"

Or CSS(debug)# icp probe host 172.17.249.22

CSS11503# sh keepalive


Let me check what Is the response code so that I can predict actually where you are facing problem.



The sh keepalive command provides a complete summary of all keepalives on the CSS. If you see State: Alive, you know that that service has been configured, and the CSS can see the device. This command also provides information on what type of keepalive it is and the specifics on what will make the service fail. The services starting with AUTO_ are default services generated by the CSS when you add a service; this includes the default gateway. If a service is shown as State: Down, you need to check your connection from the CSS to your real server (by default it takes three failures of a particular keepalive to mark a service as down). State:Dying means the CSS has not yet had contact with the real server.

The keepalive URI points to a piece of content on the website. This can be a simple page that says the word hello, or it can be any dynamic page you choose. If this page becomes unavailable, then the CSS will mark that server as down and redirect traffic to the other server where the keepalive URI is successful. The HEAD keepalive is used for dynamic content and the GET keepalive is used for static content. The GET keepalive has a tendency to fail when used against ColdFusion content, even when it is used to probe very simple dynamic content. The HEAD keepalive is a reliable means of monitoring the health and availability of a application

When you specify a Uniform Resource Identifier (?) (URI) for an HTTP keepalive, the CSS calculates a hash value for the Web page specified in the URI. If the Web page changes, the hash value no longer matches the original hash value and the CSS assumes that the service is dead. To prevent the CSS from assuming that a service is dead due to a hash value mismatch, define keepalive method as head. The CSS does not compute a hash value for this type of keepalive.

If you specify the URI of a Web page with changeable content and do not specify the head keepalive method, you must suspend and reactivate the service each time the Web page changes.



To specify how many times the IP address can fail to respond to a keepalive message before being considered dead, use the maxfailure command. Use the no form of this command to reset the maximum failure number to its default value of 3.

maxfailure number

The maximum failure number. Enter an integer from 1 to 10. The default is 3.


Sachinga.hcl



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
Loading.
teodor.dobrev Fri, 05/29/2009 - 04:50
User Badges:

Just to add something,

it's most probably because the CSS does not fill in the Host header field with the specified URI, and that exact web server is answering with 200 OK only if you have the proper Host header.

If i change the http-respcode to 400, the service goes Alive :), but that's a workaround that is not good.

So the question is how to specify what host header is sent in the Keepalives?

Correct Answer
sachinga.hcl Fri, 05/29/2009 - 11:14
User Badges:
  • Silver, 250 points or more

As you are getting response code as


400 - Bad Request

The syntax of the request was not understood by the server.


So if possible created a webpage under root directory of web server, and confgured the "keepalive uri" point to that page. and i hope it will work.



Do some modifications as suggested follows as might it help your configuration to come up

service Server1

ip address 172.17.249.22 keepalive method head

keepalive uri "http://www.server1.bg" ---- > remove http from this line

keepalive type http

keepalive port 80

protocol tcp ----- >remove this line

active



You can try to add "keepalive type http non-persistent" command and see if it works.

service Server1

ip address 172.17.249.22

keepalive method head

keepaliveport 80

keepalive uri "//www.server1.bg" --- > or change the uri page to some other in the root directory if possible.




Enter the content information for a URI as a quoted text string with a maximum length of 64 characters. Do not include the host information in the string. The CSS derives the host information from the service IP address and the keepalive port number.


keepalive type http

keepalive type http non-persistent

active


If it doesn't work then please post the output from the following commands....


CSS# llama

CSS(debug)# icp probe service server1 "http://www.server1.bg"

CSS(debug)# icp probe host 172.17.249.22 "http://www.server1.bg"

Or CSS(debug)# icp probe host 172.17.249.22

CSS11503# sh keepalive


Let me check what Is the response code so that I can predict actually where you are facing problem.



The sh keepalive command provides a complete summary of all keepalives on the CSS. If you see State: Alive, you know that that service has been configured, and the CSS can see the device. This command also provides information on what type of keepalive it is and the specifics on what will make the service fail. The services starting with AUTO_ are default services generated by the CSS when you add a service; this includes the default gateway. If a service is shown as State: Down, you need to check your connection from the CSS to your real server (by default it takes three failures of a particular keepalive to mark a service as down). State:Dying means the CSS has not yet had contact with the real server.

The keepalive URI points to a piece of content on the website. This can be a simple page that says the word hello, or it can be any dynamic page you choose. If this page becomes unavailable, then the CSS will mark that server as down and redirect traffic to the other server where the keepalive URI is successful. The HEAD keepalive is used for dynamic content and the GET keepalive is used for static content. The GET keepalive has a tendency to fail when used against ColdFusion content, even when it is used to probe very simple dynamic content. The HEAD keepalive is a reliable means of monitoring the health and availability of a application

When you specify a Uniform Resource Identifier (?) (URI) for an HTTP keepalive, the CSS calculates a hash value for the Web page specified in the URI. If the Web page changes, the hash value no longer matches the original hash value and the CSS assumes that the service is dead. To prevent the CSS from assuming that a service is dead due to a hash value mismatch, define keepalive method as head. The CSS does not compute a hash value for this type of keepalive.

If you specify the URI of a Web page with changeable content and do not specify the head keepalive method, you must suspend and reactivate the service each time the Web page changes.



To specify how many times the IP address can fail to respond to a keepalive message before being considered dead, use the maxfailure command. Use the no form of this command to reset the maximum failure number to its default value of 3.

maxfailure number

The maximum failure number. Enter an integer from 1 to 10. The default is 3.


Sachinga.hcl



teodor.dobrev Fri, 05/29/2009 - 22:22
User Badges:

Hi,

thank you very much this is very nice response.


I've actually kept digging so later last night i realized that I'm getting 400 message because the server just wont give me anything else if I don't send the proper host header. Then obviously i needed a way to specify the host header, otherwise i am just sending requests to the IP of the server - and that's configured to return 400, anyways i don't administer that server so it would be some effort to configure something on it.


So, there was nothing else to do but the scripted keepalive, and there's one of the default scripts ap-kal-httptag which can actually specify the host header.

An just a little ediitting (using head instead of a GET) just worked out perfect :)


if ${ARGS}[#] "NEQ" "3"

echo "Usage: ap-kal-httptag \'Hostname WebPage HostTag\'"

exit script 1

endbranch


! Defines:

set HostName "${ARGS}[1]"

set WebPage "${ARGS}[2]"

set HostTag "${ARGS}[3]"



! Connect to the remote Host

set EXIT_MSG "Connection Failure"

socket connect host ${HostName} port 80 tcp


! Send the GET request for the web page

set EXIT_MSG "Send: Failed"

socket send ${SOCKET} "HEAD ${WebPage} HTTP/1.0\nHost: ${HostTag}\n\n"


! Wait for a good status code

set EXIT_MSG "Waitfor: Failed"

socket waitfor ${SOCKET} "200"


no set EXIT_MSG

socket disconnect ${SOCKET}


exit script 0


Now i have both servers Alive and Load Balanced :)


And the service now looks like:

service Server1

ip address 172.17.249.22

keepalive type script ap-kal-httptag_2 "172.17.249.22 public.server1.bg www.public.server1.bg"

active


Thanks again,

Meanwhile I'm still testing so getting to some problem with this config is still an option :)


sachinga.hcl Sat, 05/30/2009 - 00:47
User Badges:
  • Silver, 250 points or more

Hi Teodor,


Thanks for your very kind words.

If possible plz rate so that I can be helpful to other people also as your rating will be valuable to me.


Sachinga.hcl



Actions

This Discussion