Failover Shell Tcl Extension
To define a service, one has to provide Tcl scripts to start, stop and
the service. These scripts must return the new state to the caller.
Note that if you start or stop a service from outside of
you must use the
utility to tell
that the state of a service has changed.
The Tcl commands
is a Tcl application. At startup it reads the Tcl script
given as argument to the
option, and executes it.
Three new commands
have been added to the Tcl interpreter. They are used to
define various parameters of a service or a host, i.e. the service
name, list of masters and slaves, the start, stop and reclaim procedures
and the heartbeat interval. This is the interval after which a service
is run, i.e. all the masters and slaves are queried for their state
and it is decided whether the local state needs to be changed.
contains a simple scheduler that is distantly modeled after the Unix
scheduler and takes care of running the services at the specified
failhost command defines a host. It is only used if the host
has individual parameters like a different port or protocol. Otherwise
hosts are implicitely defined when their names appear in a list of
masters or slaves. The syntax for the
failhost hostname port portnum
This requests that the port number
be used when connecting
to this particular host. This is only used if the firewall friendly
mode is used.
subcommand allows to specify the protocol, which should be
used when calling this host. It has the following syntax:
failhost hostname protocol protocol
protocol can either be a
and defaults to TCP.
The failsvc command has a the following syntax:
failsvc service subcommand args
The following subcommands are defined
- Specify the interval, after which the server should be queried
to verify the state.
- Specify the list of master hosts.
- Specify the list of slave hosts.
- Specify the Tcl procedure that should be called when starting
- Specify the Tcl procedure that should be called when stoping
- Specify the Tcl procedure that should be called when reclaiming
failtrap command has the following syntax:
failtrap subcommand parameter
The following subcommands are understood:
- This is the name of the host to send traps to.
If you don't specify a host, traps are not enabled.
- If a port argument is specified, traps are sent to this port
instead of the standard port 162 used for SNMP traps.
- use this string as the enterprise identifier in the
If you set the enterprise oid using this command, you will
also have to set the prefix for the variables, or the trap
message will not be consistent.
- use this as the object identifier prefix for the SNMP variables
communicated in the trap.
You will normally want to use the same
string as for the enterprise field.
However, this is not the default
and you have to explicitly set the prefix if you set the enterprise
use parameter as the community string (for authentication).
The default is ``public''.
must be running continuously to notice any state changes
and take appropriate action. For this reason,
can be run in the foreground using the
option, facilitating running it from
If this is done, care
should be taken that the Tcl script takes care that the services
are correctly brought the RECOVER state when
restarts, and lets only
bring up a service.
© 1999 Andreas Müller
$Id: tcl-extension.html,v 2.0 2000/09/09 19:27:46 afm Exp $