4.0.0 HP Polyserve Matrix Server Administration Guide (T5392-96052, March 2010)
NOTE:
The custom monitor dialog prompts you for a service monitor name and not a port
because you may be writing a monitor for an application that does not provide
network services and therefore needs no port.
Example of using monitors with applications
In this example, we will use service monitors with a custom application called
myservice. This application provides some facilities to clients who connect to port
2468 and speak a protocol. You have already set up a virtual host called vh1 for
the IP address to which external clients are going to connect. How do you make a
service monitor for this application?
The simplest way is to use a generic built-in TCP monitor on port 2468. This monitor
verifies that it is possible to connect to port 2468, which probably indicates most of
the time that the application is functioning. However, a problem might occur that
causes the application to continue accepting connections but not produce meaningful
output. To detect this situation, you will need a more complex and robust monitor
involving a custom script.
This script connects to port 2468, sends a string specified by the protocol, and
determines whether it has received an expected response. You distribute this script
to the same location on all servers on virtual host vh1, and then create a custom
service monitor that uses that script. This provides not only verification of the
connection, but a degree of content verification.
An example of Start and Stop scripts
Suppose the myservice application caches transactions induced by requests from
external users for later commitment to a back-end database server. You want to
ensure that if a failover occurs, any transactions previously acknowledged by one
server appear as complete to users connecting to the new server. This is the kind of
situation where Start and Stop scripts are useful.
The Stop script should commit all cached transactions to the back-end database. The
Start script should force an update of your view of the database from the back-end
server.
Then, if the service moves from the primary server to a backup, all transactions
performed on the primary will be sent to the database and from there to the backup
server before connections are directed to the backup server.
HP PolyServe Matrix Server administration guide 239