The clusterXL_monitor_process ScriptClusterXL R80.40 Administration Guide | 272The clusterXL_monitor_process ScriptDescriptionYou can use theclusterXL_monitor_processscript to monitor if the specified user space processes run,and cause cluster fail-over if these processes do not run. For this script to work, you must write the correctcase-sensitive names of the monitored processes in the$FWDIR/conf/cpha_proc_listfile - eachprocess name on a separate line. This file does not support comments or spaces.Location of this script on your Cluster Members is:$FWDIR/bin/clusterXL_monitor_processScript Workflow1.Registers Critical Devices (with the status "ok") called as the names of the processes you specifiedin the$FWDIR/conf/cpha_proc_listfile.2.While the script detects that the specified process runs, it does not change the status of thecorresponding Critical Device.3.If the script detects that the specified process do not run anymore, it reports the state of thecorresponding Critical Device as "problem".This gracefully changes the state of the Cluster Member to "DOWN".If the script detects that the specified process runs again, it changes the status of the correspondingCritical Device to "ok" again.For more information, seesk92904.Important- You must do these changes on all Cluster Members.
The clusterXL_monitor_process ScriptClusterXL R80.40 Administration Guide | 273Example
The clusterXL_monitor_process ScriptClusterXL R80.40 Administration Guide | 274#!/bin/sh## This script monitors the existance of processes in the system. The process names should be written# in the $FWDIR/conf/cpha_proc_list file one every line.## USAGE :# cpha_monitor_process X silent# where X is the number of seconds between process probings.# if silent is set to 1, no messages will appear on the console.### We initially register a pnote for each of the monitored processes# (process name must be up to 15 charachters) in the problem notification mechanism.# when we detect that a process is missing we report the pnote to be in "problem" state.# when the process is up again - we report the pnote is OK.if [ "$2" -le 1 ]thensilent=$2elsesilent=0fiif [ -f $FWDIR/conf/cpha_proc_list ]thenprocfile=$FWDIR/conf/cpha_proc_listelseecho "No process file in $FWDIR/conf/cpha_proc_list "exit 0fiarch=`uname -s`for process in `cat $procfile`do$FWDIR/bin/cphaconf set_pnote -d $process -t 0 -s ok -p register > /dev/null 2>&1donewhile [ 1 ]doresult=1for process in `cat $procfile`dops -ef| grep $process | grep -v grep > /dev/null 2>&1status=$?