HP-UX SNAplus2 R7 Administration Guide

Appendix DUsing SNAplus2 in a High Availability Environment
Note
Some networking packages, like TCP/IP, support Continuous Availability during local
failover; that is, applications do not experience outages while the system is switching
from one network adapter to another. SNAplus2 does
not support Continuous Availability
during local failovers. Applications will experience session outages, and must re-establish
LU-LU sessions with the remote SNA system after the switch has occurred.
The following command is the previously discussed Service Command for the SNAplus2 package that instructs
ServiceGuard to start the snapmon process to monitor an SNAplus2 LS.
SERVICE_CMD[0]="/opt/sna/bin/snapmon -i1 -r60 HALS"
The Service Command starts a process. The termination of this process is a signal to ServiceGuard that your package
has failed. To add local recovery options to the package, replace the Service Command with a new executable
le
(a program or shell script) that you write. For example, if you change the Service Command to say,
SERVICE_CMD[0]="/usr/local/bin/snapkg.mon"
then you can add commands to perform local recovery in a shell script called snapkg.mon. You will still use
the snapmon utility to monitor the state of your SNAplus2 LS, but you can include other SNAplus2 commands in
the script. The ability to add other SNAplus2 commands gives you a way to specify local recovery actions before
allowing the script to end.
For example, suppose you want to monitor a Token Ring LS called TRLS. If it fails, you rst try to restart TRLS.
If TRLS does not restart, you try to start an SDLC LS called SDLCLS.
Your monitor script might look like this:
#!/bin/ksh# This script monitors an SNAplus2 package, which uses the
# following SNAplus2 configuration:
#
# A node is configured to run a Token Ring
# LS, TRLS, and an SDLC LS, SDLCLS. TRLS uses a port
# called TRPORT, and SDLCLS uses a port called SDLCPORT.
#
# If the primary LS ever fails, the script performs three steps
# to restore SNA network connectivity.
#
# Step 1: Attempt local restart of TRLS. If successful, monitor
# the LS, then return to Step 1. Otherwise, go to Step 2.
#
# Step 2: Attempt local failover to SDLCLS. Monitor the LS
# until it fails, then go to Step 3.
#
# Step 3: Exit, which will inform ServiceGuard of a complete
# package failure. Service Guard will then perform
# remote failover.
#
# Add the SNAplus2 command directory to PATH.
#
PATH=/opt/sna/bin:$PATH
#-------------------------------------------------------------
# STEP 1: Local restart
#-------------------------------------------------------------
#
# Start (or restart) the primary LS. If local restart is
# successful, then loop back to try it again.
#
exitcode=0
225