When load balancing is set up, it is helpful to monitor the health of the real servers and the applications running on them. For instance, in web servers, you can set up a specific page that you can use to monitor the state or use one of the other monitoring systems the ADC has.
The Library > Real Server Monitors page allows you to add, view and edit custom monitoring. These are Layer 7 server "Health Checks" and select them from the Server Monitoring field within the Basic tab of the Virtual service you define.
The Real Server Monitors page is split into three sections.
· Details
· Upload
· Custom Monitors
Details
The Details section is used to add new monitors and to remove any that you do not need. You can also edit an existing monitor by double-clicking on it.
Name
Name of your choice for your monitor.
Description
Textual description for this Monitor, and we recommend that it is best to make it as descriptive as possible.
Monitoring Method
Choose the monitoring method from the drop-down list. Available choices are:
Monitoring Method
|
Description
|
Example
|
HTTP 200 OK
|
A TCP connection is made to the Real Server. After the connection is made, a brief HTTP request is sent to the Real Server. An HTTP response from the server is waited for and is then checked for the "200 OK" response code. If the "200 OK" response code is received, the Real Server is deemed to be up and running. If, for any reason, the "200 OK" response code is not received, including timeouts or failure to connect, then the Real Server is regarded as down and unavailable. This monitoring method can only really be used with HTTP and Accelerated HTTP service types. However, if a Layer 4 Service Type is in use for an HTTP server, it could still be used if SSL is not in use on the Real Server or handled appropriately by the "Content SSL" facility.
|
Name: 200OK
Description: Check production web site
Monitoring Method: HTTP 200 OK
Page Location: /main/index.html OR HTTP://www.edgenexus.io/main/index.html Required Content: N/A
|
HTTP Response
|
A connection and HTTP request/response is made to the Real Server and checked as explained in the previous example. But rather than check for a "200 OK" response code, the HTTP response’s header is checked for custom text content. The text can be a full header, part of a header, a line from part of a page, or just one word. If the text is found, the Real Server is deemed to be up and running. This monitoring method can only really be used with HTTP and Accelerated HTTP service types. However, if a Layer 4 Service Type is in use for an HTTP server, it could still be used if SSL is not in use on the Real Server or handled appropriately by the "Content SSL" facility.
|
Name: Server Up
Description: Check the content of the page for "Server Up."
Monitoring Method: HTTP Response
Page Location: /main/index.html OR HTTP://www.edgenexus.io/main/index.html Required Content: Server Up
|
DICOM
|
We send a DICOM echo using the "Source Calling" AE Title value in the required content column. You can also set the "Destination Called" AE Title value in the Notes section of each server. You can find the Notes column within the IP Services-
-Virtual Services--Server page.
|
Name: DICOM
Description: L7 health check for DICOM service
Monitoring Method: DICOM
Page Location: N/A
Required Content: AET Value
|
TCP Out of Band
|
The TCP Out of Band method is like a TCP Connect except that you can specify the port you wish to monitor in the required content column. This port is typically not the same as the traffic port and is used when you want to tie services together
|
Name: TCP Out of Band
Description: Monitor Out of Band/Traffic port
Page Location: N/A
Required Content: 555
|
Multi-Port TCP monitor
|
This method is like the above except that you can have several different ports. The monitor is deemed successful only if all ports specified in the required content section respond correctly.
|
Name: Multi-Port Monitor
Description: Monitor multiple ports for success
Page Location: N/A
Required Content: 135,59534,59535
|
|
|
|
Page Location
URL Page location for an HTTP monitor. This value can be a relative link such as /folder1/folder2/page1.html. You can also use an absolute link where the website is bound to the hostname.
Required Content
This value contains any content that the monitor needs to detect and utilize. The value represented here will change depending on the monitoring method that is chosen.
Applied to VS
This field is automatically populated with the IP/Port of the Virtual Service to which the monitor is applied. You will not be able to delete any Monitor that has been used with a Virtual Service.
User
Some custom monitors can use this value along with the password field to log into a Real Server.
Password
Some custom monitors can use this value along with the User field to log into a Real Server.
Threshold
The Threshold field is a general integer used in custom monitors where a threshold such as the CPU level is required.
NOTE: Please ensure the response back from the Application server is not a "Chunked" response
Real Server Monitor examples
Upload Monitor
There will be many occasions when users wish to create their own custom monitors and this section allows them to upload them to the ADC.
Custom monitors are written using PERL scripts and have a .pl file extension.
· Give your monitor a name so that you can identify it in the Monitoring Method list
· Browse for the .pl file
· Click Upload New Monitor
· Your file will be uploaded to the correct location and will be visible as a new Monitoring Method.
Custom Monitors
In this section, you can view custom monitors uploaded and remove them if they are no longer needed.
· Click the drop-down box
· Select the name of the custom monitor
· Click Remove
· Your custom monitor will no longer be visible in the Monitoring Method list
Creating a Custom Monitor Perl Script
CAUTION: This section is intended for persons with experience in using and writing in Perl
This section shows you the commands you can use within your Perl script.
The #Monitor-Name: command is the name used for the Perl Script stored on the ADC. If you do not include this line, then your script will not be found!
The following are mandatory:
· #Monitor-Name
· use strict;
· use warning;
The Perl scripts are run in a CHROOTED environment. They often call another application such as WGET or CURL. Sometimes these need to be updated for a specific features, such as SNI.
Dynamic Values
· my $host = $_[0]; - This uses the “Address” from IP Services--Real Server section
· my $port = $_[1]; - This uses the “Port” from IP Services--Real Server section
· my $content = $_[2]; - This uses the “Required Content” value from the Library--Real Server Monitoring section
· my $notes = $_[3]; - This uses the “Notes” column in Real Server section of IP Services
· my $page = $_[4]; - This uses the “Page Location” values from Library--Real Server Monitor section
· my $user = $_[5]; - This uses the “User” value from the Library--Real Server Monitor section
· my $password = $_[6]; - This uses the “Password” value from the Library--Real Server Monitor section
Custom Health Checks have two outcomes
· Successful
Return Value 1
Print a success message to Syslog
Mark the Real Server Online (provided IN COUNT match)
· Unsuccessful
Return Value 2
Print a message saying Unsuccessful to Syslog
Mark the Real Server Offline (provided OUT Count match)
Example of a Custom Health Monitor
#Monitor-Name HTTPS_SNI
use strict:
use warnings;
# The monitor name as above is displayed in the drop-down of Available health checks
# There are 6 value passed to this script (see below)
# The script will return the following values
# 1 is the test is successful
# 2 if the test is unsuccessful sub monitor
{
my Shost = $_[O]; ### Host IP or name
my Sport = $_[1]; ### Host Port
my Scontent = $_[2]; ### Content to look for (in the web page and HTTP headers)
my Snotes = $_[3]; ### Virtual host name
my Spage = $_[4]; ### The part of the URL after the host address
my Suser = $_[5]: ### domain/usemame (optional)
my Spassword = $_[6]; ### password (optional)
my $resolve;
my $auth =;
if ($port)
{
$resolve = "$notes:$port:$host":
}
else {
$resolve = "$notes:$host";
}
if ($user && $password) {
$auth = ”-u $user:$password :
}
my @lines = 'curl -s -i -retry 1 -max-time 1 -k -H "Host:$notes --resolve $resolve $auth HTTPs://${notes}${page} 2>&1'; if(join(””@lines)=~/$content/)
{
print "HTTPs://$notes}${page} looking for - $content - Health check successful.\n”;
return(1);
}
else
{
print "HTTPs://${notes}${page} looking for - $content - Health check failed.\n";
return(2)
}
}
monitor(@ARGV):
NOTE: Custom Monitoring – Use of global variables is not possible. Use local variables only – variables defined inside functions