Getting service-specific advice with the advisor request or response option

After you start an HTTP or HTTPS advisor, you can define a unique client HTTP URL string, specific for the service that you want to query on the server. This URL allows the advisor to assess the health of the individual services within a server.

About this task

For each defined logical server under the HTTP port, you can specify a unique client HTTP URL string, specific for the service that you want to query on the server. The HTTP or HTTPS advisor uses the advisorrequest string to query the health of the servers. The default value is HEAD / HTTP/1.0.

The advisorresponse string is the response that the advisor scans for in the HTTP response. The advisor uses the advisorresponse string to compare to the real response that is received from the server. The default value is null.

Procedure

Issue the server set command with the advisorrequest and advisorresponse parameters.
  • When issuing the command from the dscontrol>> shell prompt, you must place quotation marks around the string if a blank is contained within the string, as shown in the following example.
    server set cluster@port@server advisorrequest "head / http/1.0"
    
    server set cluster@port@server advisorresponse "HTTP 200 OK" 
  • When issuing the dscontrol command from the operating system prompt, you must precede the text with ″\″ and follow the text with \"", as shown in the following example.
    dscontrol server set cluster@port@server advisorrequest "\"head / http/1.0\""
    
    dscontrol server set cluster@port@server advisorresponse "\"HTTP 200 OK\"" 
Note: After you start an HTTP or HTTPS advisor for a specified HTTP port number, the advisor request and response value is enabled for servers under that HTTP port. For more information, see dscontrol server.

The Load Balancer automatically adds certain HTTP headers to the advisorrequest string for HTTP and HTTPS advisors. Only the Host header can be modified.

The following table lists the headers and values that the Load Balancer adds to the advisorrequest string for an HTTP advisor.

Table 1. HTTP headers and values for HTTP advisors
HTTP header Value
Host The server name ion the Load Balancer configuration. For more information, see Host header values.
User-Agent IBM_Load_Balancer_HTTP_Advisor
Accept */*

The following table lists the headers and values that the Load Balancer adds to the advisorrequest string for an HTTPS advisor.

Table 2. HTTP headers and values for HTTPS advisors
HTTP header Values
Host The server name ion the Load Balancer configuration. For more information, see Host header values.
User-Agent IBM_Load_Balancer_Https_Advisor
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Encoding gzip
Accept-Language en
Accept-Charset iso-8859-1,*,utf-8
Connection close
Host header values
The value in the Host header is the server name that is used when the server definition is added to the Load Balancer. The following examples demonstrate the Host header that is added for different dscontrol commands, where a server has a hostname of server.ibm.com and the hostname resolves to the 1.2.3.4 IP address.
  • The Host header for the following command is Host: server.ibm.com
    dscontrol server add mycluster@80@server.ibm.com
  • The Host header for the following command is Host: server.
    dscontrol server add mycluster@80@server
  • The Host header for the following command is Host: myserver.
    dscontrol server add mycluster@80@myserver address 1.2.3.4
When the advisorrequest string contains the Host header, The Load Balancer uses the value that is set in the advisorrequest string, as demonstrated in the following examples.
  • The Host header for the following command is Host: server.ibm.com.
    dscontrol server add mycluster@80@myserver address 1.2.3.4 advisorrequest "\"HEAD / HTTP/1.1\r\nHost: server.ibm.com\""
  • The Host header for the following command is empty, Host: . The web server typically responds with a 400 Bad Request error when no value is assigned to the header.
    dscontrol server add mycluster@80@myserver address 1.2.3.4 advisorrequest "\"HEAD / HTTP/1.1\r\nHost: \""
Note: Do not use the sequence of a quotation mark followed by a space in the advisorrequest or advisorresponse fields, for example, " . A quotation mark followed by a space is interpreted as the end of field input.