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

Status
Not open for further replies.
S

ssouthwe

Guest
OE12.0, PASOE The documentation around how oejmx works seems to show some simple examples, but doesn't go into detail on syntax. In some cases, there's a disconnect between what the docs say, and how it actually behaves. My question relates to .qry files with multiple query lines. The documents and examples hint at a few things: Queries can have multiple lines in them (see default.qry that ships with the product) Queries have substitution tokens such as AGENT_ID. I can't tell whether this is just some typographic convention for documentation, or whether you can have a parameterized query. It seems absurd to make a user write a new query just to add an agent_id to it. Data from one query's output can be used in another query. Testing this out, I created a query: (I'd like to use RefreshAgents, but it doesn't exist in v12) {"O":"PASOE:type=OEManager,name=AgentManager","M":["getAgents","oePasABL"]} {"O":"PASOE:type=OEManager,name=AgentManager","M":["stopAgent","AGENT_ID",10,10]} What I thought might happen is that the output from the first line would feed into the second line, replacing AGENT_ID. What actually happened was that it ignored the App name I gave it "oePasABL" and instead ran stopAgent against every single app I had on the instance, and every agent under each app. Here's the output: Query: Line 1. Object: PASOE:type=OEManager,name=AgentManager, Method: getAgents(oePasABL) Result: {"getAgents":{"agents":""}} #==================================== Query: Line 0. Object: PASOE:type=OEManager,name=OeablServiceManager, Attribute: Applications Result: {"Applications":[{"OEType":"APPLICATION","webapps":[ snip ]} #==================================== Query: Line 0. Object: PASOE:type=OEManager,name=AgentManager, Method: getAgents(CreateABL) Result: {"getAgents":{"agents":[{"agentId":"-rsNQkuiR2KydGbPvCGx0w","pid":"23874","state":"AVAILABLE"}]}} #==================================== Query: Line 0. Object: PASOE:type=OEManager,name=AgentManager, Method: getAgents(oePasABL) Result: {"getAgents":{"agents":""}} Result: Error!: Not valid agent info #==================================== Query: Line 0. Object: PASOE:type=OEManager,name=AgentManager, Method: getAgents(anotherpas) Result: {"getAgents":{"agents":[{"agentId":"R5rxI0NkQXaJquiIQtzd6w","pid":"23846","state":"AVAILABLE"}]}} #==================================== Query: Line 2. Object: PASOE:type=OEManager,name=AgentManager, Method: stopAgent(-rsNQkuiR2KydGbPvCGx0w, 10, 10) Result: {"stopAgent":true} #------------------------------------ Query: Line 2. Object: PASOE:type=OEManager,name=AgentManager, Method: stopAgent(R5rxI0NkQXaJquiIQtzd6w, 10, 10) Result: {"stopAgent":true} What's the syntax (if any) to get one query to feed into another? If this isn't possible, what's the best way in V12 to kill off all the agents for a given ABL app? Restarting the instance is not a viable option for production, nor is OEManager or anything that isn't scriptable. I'd really rather have a very simple command-line that I can run, instead of having to try to write some code or install a component that the docs say is not for production. Thanks.

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