Monitor entry point for FileOnOff

When the agent's monitor entry point is called by the agent, the entry point expects the name of the resource as the first argument, followed by the values of the remaining ArgList attributes.

If the file exists it returns exit code 110, indicating the resource is online with 100% confidence. If the file does not exist the monitor returns 100, indicating the resource is offline. If the state of the file cannot be determined, the monitor returns 99.

The below mentioned example is applicable for agent version V50 and later.

#!/bin/sh
# FileOnOff Monitor script
# Expects Resource Name and Pathname

. "${CLUSTER_HOME}/bin/ag_i18n_inc.sh"
RESNAME=$1
VCSAG_SET_ENVS $RESNAME
#check if second attribute provided
#Exit with unknown and log error if not provided.
if [ -z "$4" ]
then
    VCSAG_LOG_MSG "W" "The value for PathName is not specified" 1020
    exit 99
else
    if [ -f $4 ]; then exit 110;
    # Exit online (110) if file exists
    # Exit offline (100) if file does not exist
    else exit 100;
    fi
    fi