This article describes how to configure service monitoring so that the health of one service is tied to the health of another potentially related service. For service A to fail, either services A or B must fail their monitors.
The NetScaler allows multiple monitors to be bound to a service. These monitors by default monitor the service they are bound to, but can be configured to monitor any destination IP address, port, or both. A practical example of this is a web server which makes a call to a back end database server where, if the database server fails, you also want the web server to be marked as down.
Complete the following procedure to configure Service Monitoring:
Configure the two services:
add service http_brown 10.198.4.61 HTTP 80
add service database_purple 10.198.4.62 HTTP 80
Set the service monitoring threshold to 11 on HTTP service which depends on the database service for its health. When this value is combined with monitor weights it allows you to control how many monitors must fail before you consider the service down. In this case if either monitor fails, NetScaler marks the service as down:
set service http_brown -monThreshold 11
Configure the monitors.
Two of the monitors uses default settings and verifies the services they are bound to, and the third monitor verifies database_purple specifically and is bound to http_brown.
Notice that when the monitor database_check is bound to http_brown it is bound with a weight of 10. By default, a monitor has a weight of 1, so if you take the 10 from database_check plus the 1 from the HTTP monitor, you arrive at a threshold of 11. As long as both of these monitors are up, the threshold is satisfied. If any one of the monitors fails the threshold is no longer satisfied and the service is marked as down:
add lb monitor database_check TCP -LRTM ENABLED -destIP 10.198.4.62 -destPort 80
bind lb monitor http database_purple
bind lb monitor database_check http_brown -weight 10
bind lb monitor http http_brown
When using this configuration http_brown will fail if its own default HTTP monitor fails, or if its database_check monitor fails. This ensures that if the back end database server is down, NetScaler also mark the dependent web server down.