3.5.1 Matrix Server Administration Guide
Chapter 17: Advanced Monitor Topics 281
Copyright © 1999-2007 PolyServe, Inc. All rights reserved.
Built-In Monitor or User-Defined Monitor?
To decide whether to use a built-in monitor or a user-defined monitor,
first determine whether a built-in monitor is available for the service you
want to monitor and then consider the degree of content verification that
you need. If you are monitoring a custom application for which a built-in
monitor is not available but the application provides network services
through certain ports, you may consider it sufficient to use built-in TCP
monitors on each of those ports.
However, if you want to verify that the application is still accepting
connections to the port and is also producing reasonable output, you
should use a user-defined service monitor. You will need to write a probe
script that connects to the port and then tests how the script responds to
various commands.
NOTE: The user-defined 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.
A Sample Custom Monitor
This example uses 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
script written with a utility such as expect(1).
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