Forum Discussion

paragarw's avatar
paragarw
Level 4
10 years ago

Failed to execute postonline trigger

Postline trigger is getting failed to execute on onlining a resource. Getting a below error.

 

2015/02/27 01:25:47 VCS INFO V-16-6-15003 (dsacl2ip) hatrigger:Failed to execute /opt/VRTSvcs/bin/triggers/postonline dsacl2ip SG-APP-TM-003
2015/02/27 01:29:27 VCS INFO V-16-6-15003 (dsacl2ip) hatrigger:Failed to execute /opt/VRTSvcs/bin/triggers/postonline dsacl2ip SG-APP-TM-003

 

i manually executed the command hatrigger -postonline 0 dsacl2ip SG-APP-TM-003 but again same error.

Please let me know what can be the issue.

 

Below is my script

 

ccmId="@(#)%name: postonline % %version: 5 %, %date_modified: Thu Feb 19 12:13:59 2015 %"

#####################################################
# Configure required IP addresses for TM in this section
#####################################################
export TMVIRTIP=10.225.230.57
export TMIPADDRS="
10.15.14.139
10.15.15.137
10.215.17.0

"

#####################################################
# Configure required IP addresses for APPin this section
#####################################################
export RMVIRTIP=10.225.238.58
export RMIPADDRS="
192.168.17.4
"

#####################################################
#
# DO NOT CHANGE ANYTHING BELOW THIS LINE
#
#####################################################

#####################################################
if [ -z "$VCS_HOME" ]; then
    VCS_HOME=/opt/VRTSvcs
fi

#####################################################
# Source VCS helper script
if [ -r $VCS_HOME/bin/ag_i18n_inc.sh ]; then
    . $VCS_HOME/bin/ag_i18n_inc.sh
else
function VCSAG_LOG_MSG {
    msgtype=$1
    msgtxt="$2"
    category="$3"
    case $msgtype in
        E) msgtype="ERROR:";;
        W) msgtype="WARNING:";;
        I) msgtype="INFO:";;
    esac
    echo "`date +'%m/%d %T'`: $msgtype $msgtxt ($category)"
}
fi

#####################################################
# Check if relevant arguments were provided
system=$1
group=$2
if [ -z "$system" ]; then
    VCSAG_LOG_MSG "W" "Failed to continue; undefined system name" 15028
    exit
elif [ -z "$group" ]; then
    VCSAG_LOG_MSG "W" "Failed to continue; undefined group name" 15031
    exit
fi

#####################################################
# Determine the interface that the APP virtual IP is bound to
function getInterface {
    /bin/netstat -ie | grep -B1 "$1" | sed -ne "s/\(^$2.*\) *Link.*/\1/p"
}

#####################################################
function addRoutes {
    typeset device=$1
    typeset gwAddr=$2
    shift 2

    typeset maskAddr
    for ipAddr in $*; do
        if [ "${ipAddr##*.}" = "0" ];then
            maskAddr=255.255.255.0
        else
            maskAddr=255.255.255.255
        fi

        echo /sbin/route add -net $ipAddr netmask $maskAddr gw $gwAddr dev $device
    done
}

#####################################################
case $group in
    SG-APP-TM-003)
        virtInterface=$(getInterface $TMVIRTIP bond)
        if [ -z "$virtInterface" ]; then
            VCSAG_LOG_MSG "E" "Could not determine interface for virtual IP" 15032
        else
            VCSAG_LOG_MSG "I" "Adding routes for interface $virtInterface" 15032
            addRoutes $virtInterface 10.225.238.2 $TMIPADDRS
        fi
        ;;
    SG-APP-DS_RM-004)
        virtInterface=$(getInterface $RMVIRTIP bond)
        if [ -z "$virtInterface" ]; then
            VCSAG_LOG_MSG "E" "Could not determine interface for virtual IP" 15032
        else
            VCSAG_LOG_MSG "I" "Adding routes for interface $virtInterface" 15032
            addRoutes $virtInterface 10.225.238.5 $RMIPADDRS
        fi
        ;;
    *)  ;;
esac

  • the issue got sorted out..problem was with the script.

  • the issue got sorted out..problem was with the script.