Hello,
I have the same problem here, the way we managed to overcome this problem here was as follows ...
in the creation of the domains of the applications, we put a unique identifier of that application for example 00023 followed by "-" and a mnemonico (00023-selles), then in the action we pass 3 parameters: pass text to shel, alert status and agent name (s) .
so it was only dealing with those values we passed in the shell script we created ... I'm using more or less like this:
!/bin/sh
#
# Determine automatically where our home is.
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
# Set environment
if [ -f $PRGDIR/setIscEnv.sh ] ; then
# . $PRGDIR/setIscEnv.sh
source $PRGDIR/setIscEnv.sh
else
echo "There is no environment setup file: setIscEnv.sh"
echo "Please re-run configureWily in installation directory!"
exit
fi
#---------------Set the log file-----------------------------------------#
LOG_FILE=/opt/programas/apm/mom/log/chamado.log
#______________Receipt of values--------------------------------#
ALERT=$1
ALERT_STATUS=$2
AGENT_NAME=$3
#---------------Define Agent Name and Instance Name----------------------#
AGENT_INSTANCIA=$AGENT_NAME
NOME_AGENTE=`echo $AGENT_NAME|awk -F"|" '{print $(NF-2)}'`
NOME_AGENTE=`echo $NOME_AGENTE | sed -e "s/]\"//g"`
NOME_INSTANCIA=`echo $AGENT_INSTANCIA|awk -F"|" '{print $(NF)}'`
NOME_INSTANCIA=`echo $NOME_INSTANCIA | sed -e "s/]\"//g"`
#--------------Treat the data to get the service code and the name of the application-#
TT_AGENTS=`echo $AGENT_NAME|awk -F"|" '{print $(NF)}'`
TT_AGENTS=`echo $TT_AGENTS | sed -e "s/]\"//g"`
DOMAIN=`echo $AGENT_NAME|awk -F"|" '{print $(NF-3)}'`
DOMAIN=`echo $DOMAIN | sed -e "s/\"\[//g"`
DOMAIN_ARRAY=( $(echo $DOMAIN | tr "-" "\n") )
COD_SERV="0000"
APLIC=$TT_AGENTS
if [ "X${DOMAIN_ARRAY[1]}" != "X" ]; then
COD_SERV=${DOMAIN_ARRAY[0]}
COD_SERVV=`echo $COD_SERV | awk -F"\/" '{print $(NF)}'`
APLIC=${DOMAIN_ARRAY[1]}
fi