[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: OEJMX - Chained Queries

Status
Not open for further replies.
S

ssouthwe

Guest
For what it's worth, I had to build a shell script to get this done. It's dirty as heck, but it works: stopagents.sh #/bin/sh ####################################### # Query for running agents using oejmx. # Stop those agents # by S.E. Southwell ####################################### # Customize these CATALINA_HOME=/apps/applications/pasoe/dev APP_NAME=$1 TEMP=$CATALINA_HOME/temp if [ "$1" == "" ]; then echo "No ABL appname was provided. Usage: restartagents.sh ABLappname" else cd $TEMP echo \{\"O\":\"PASOE:type=OEManager,name=AgentManager\",\"M\":[\"getAgents\",\"oePasABL\"]\} > ./${APP_NAME}agents.qry $CATALINA_HOME/bin/oejmx.sh -Q ./${APP_NAME}agents.qry -R -O ./agentslist.json cat ./agentslist.json | sed 's/^.*agentId/\nagentId/g' | sed 's/,.pid.*$//g' | sed 's/"//g' | grep agentId | sed 's/agentId://g' > agentslist.txt while read line do echo \{\"O\":\"PASOE:type=OEManager,name=AgentManager\",\"M\":[\"stopAgent\",\"$line\",10,10]\} > ./${APP_NAME}stopagent.qry $CATALINA_HOME/bin/oejmx.sh -Q ./${APP_NAME}stopagent.qry -R -O ./stoplist.json cat ./stoplist.json done < agentslist.txt fi

Continue reading...
 
Status
Not open for further replies.
Top