Use an OEJMX query to get agent information
- Last Updated: July 3, 2024
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
Use OEJMX with the -Q filepathname parameter to use a custom query file. A query
file can have multiple queries. For more information about the OEJMX command syntax, see
OEJMX utility.
Each JMX query is a JSON string with an MBean identifier and attribute or operation information. The query format is:
-
O—ObjectName is a JsonObject -
M—Operation is a JsonArray -
A—(optional) Attribute is a JsonObject
|
In List available MBeans to locate AgentManager details,
steps are provided to list the available MBeans. From that list, the operations and
attributes for the AgentManager are identified. To collect information about the agents,
create a custom OEJMX query file using the getAgents
API for the default oepas1 instance.
To write a custom OEJMX query:
- Create a new file in your PAS for OpenEdge instance's bin\jmxqueries directory called getAgents.qry.
- Add the following line to the getAgents.qry
file:
{"O":"PASOE:type=OEManager,name=AgentManager","M":["getAgents","oepas1"]}This line contains a JMX query to access the AgentManager MBean, and specifically the
getAgentsJMX API. This provides information about the running agents in the PAS for OpenEdge instance, which can be used to get thread and session information, status, and other metrics.The query returns the agent information for the default
oepas1instance. If you are running this query on a PAS for OpenEdge instance with a different name, changeoepas1to the name of the current instance or ABL application that you want to get agent information about.If you want agent information for all running ABL applications on the PAS for OpenEdge instance, you can specify
APP_NAMEinstead ofoepas1(or other ABL application name).APP_NAMEis a supported token that returns information for all ABL applications on the PAS for OpenEdge instance. More information about supported tokens is described inCommon OEJMX queries.Note: A query must be a single line that does not contain embedded spaces. A query file can contain multiple queries. The best practice is to use explicit names over tokens to guarantee the intended results. In this example,oepas1replaces the APP_NAME token. - Navigate to the bin directory of the instance, for
example:
proenv>cd %WRKDIR%\oepas1\bin - Ensure the instance is running by executing the following command:
proenv>tcman pasoestart -restart - Run the OEJMX getAgents query that you created in step one, for
example:
proenv>oejmx -Q jmxqueries\getAgents.qryThe default output location is instance_name/temp/queryname-out-yyMMdd-HHmm.txt.
- Review the output
getAgents-outyyMMdd-HHmm.txtfile in the instance_name/temp directory to see the query response, for example:Query: Line 1. PASOE:type=OEManager,name=AgentManager, getAgents(oepas1) Result: {"getAgents":{"agents":[{"agentId":"b4XlcFFOR_uh68bStvHe1Q","pid":"26896","state":"AVAILABLE"}]}}Note: The output shows the original query on line 1 and the results on the next line. The original query message can be suppressed by running the OEJMX query with the -R option, for example:
For more information about the OEJMX command syntax, see OEJMX utility.proenv>oejmx -Q jmxqueries\getAgents.qry -RThe output of the getAgents query provides the Agent ID and PID for the running ABL application agents. You can use this information to gather more information about your agent, such as threads and session metrics. For more information, see Use an OEJMX query to get session metrics and Common OEJMX queries.